JSON検証

トレンド 🔥

JSON構文を検証してフォーマットします。

開発者ツール

JSON検証 の使い方

  1. 1JSONを貼り付ける
  2. 2「JSONを検証」をクリックする
  3. 3有効かどうか確認するか、正確なエラー位置を取得する
  4. 4有効な場合、フォーマット済みJSON出力をコピーする

JSON検証 について

JSONバリデーターはJSON文字列が構文的に有効かどうかを確認します。有効な場合、解析されフォーマットされたJSON出力を表示します。無効な場合、構文エラーの正確な位置とエラーメッセージを表示します。

JSON検証の主な機能

  • Instant JSON syntax validation using the browser's native JSON.parse()
  • Displays exact error message and position for invalid JSON
  • Shows formatted, pretty-printed JSON output when valid
  • Clear visual pass/fail indicator
  • Works with any valid JSON value — objects, arrays, strings, numbers
  • Works entirely in-browser — no server uploads
  • One-click copy for the formatted output
  • Handles large and deeply nested JSON documents

使用例

Validate an API response before parsing in code

Confirm that a copied API response is valid JSON before using it in your application.

入力

{"user":{"id":1,"name":"Alice"},"token":"abc123"}

出力

Valid JSON ✓ — formatted output displayed

Debug a configuration file with a syntax error

Find the exact location of a syntax error in a malformed config file.

入力

{"host":"localhost","port":3000,}

出力

Invalid JSON — SyntaxError: Unexpected token } at position 32 (trailing comma)

主な使用ケース

  • Validating API response payloads before writing parsing code
  • Checking JSON configuration files (package.json, tsconfig.json) for syntax errors
  • Debugging webhook payloads that are failing to parse in your application
  • Verifying data exports from databases or ETL pipelines
  • Checking environment variables that contain JSON-encoded values
  • Teaching JSON syntax by seeing clear, immediate error feedback

トラブルシューティング

Trailing comma after the last element

解決策

JSON does not allow trailing commas. Remove the comma after the last property in an object or the last element in an array.

Single quotes used instead of double quotes

解決策

JSON requires double quotes for all strings and property names. Replace all single quotes with double quotes.

Unexpected end of JSON input

解決策

A bracket or brace is not closed. Check that every { has a matching }, every [ has a matching ], and all strings are properly closed with double quotes.

よくある質問

Does it fix invalid JSON?

No. The validator identifies the exact error but does not automatically repair the JSON. Use the error message and position to locate and fix the issue manually, then re-validate.

What errors are shown?

The exact JavaScript JSON.parse() error message is displayed, including the position (character index) where the syntax error was detected. This matches what your application code would receive.

What is the most common JSON syntax error?

Trailing commas after the last property or array element are the most common mistake, followed by single-quoted strings and missing closing brackets. JSON is strict — it follows RFC 8259 exactly.

Can it validate JSON Schema compliance?

This tool validates JSON syntax only. It does not check whether the data matches a JSON Schema (e.g., required fields, data types). For schema validation, use a dedicated JSON Schema validator.

Does it support JSON5 or JSONC?

No. This tool validates strict RFC 8259 JSON. JSON5 features like comments, trailing commas, and unquoted keys will cause validation to fail. Remove these extensions before validating.

Can I validate very large JSON files?

Yes. The validator uses the browser's native JSON.parse() which handles large files efficiently. Files over 10 MB may cause a brief delay, but there is no hard size limit.

Is my data sent to a server?

No. All validation is performed locally in your browser using JSON.parse(). Your JSON data never leaves your device and is not stored or transmitted anywhere.

Why does the error position not match my line number?

JSON.parse() reports the character position from the start of the string, not a line number. Count characters from the beginning of the JSON, or use the formatted output view which may make the issue visually apparent.