Diysb Tools

JSONを検証する

JSON が有効かつ整形式であるかどうかを確認します。

JSONツール

JSON 検証とは何ですか?

JSON(JavaScript Object Notation)は軽量なデータ交換形式です。JSON検証は、データの構造がJSON標準に準拠していることを確認します。有効なJSONオブジェクトには、以下の要素が必要です:二重引用符で囲まれたプロパティ名、適切にバランスされた中括弧、不要なカンマの除去、適切にネストされたオブジェクトと配列。このツールは入力されたJSONを検証し、一般的なエラーを特定して修正するためのフィードバックを提供します。

入力JSON
検証結果
JSONを検証する 例

Valid JSON Object

This example shows a correctly formatted JSON object. All property names and string values are enclosed in double quotes, and the overall structure is properly balanced with opening and closing braces.

{ "name": "John", "age": 30, "city": "New York" }
{ "name": "John", "age": 30, "city": "New York" }
✅ Valid JSON
✅ Valid JSON

Invalid JSON Missing Quotes

This example demonstrates an invalid JSON object where the property names are not enclosed in double quotes. According to the JSON standard, property names must always be enclosed in double quotes. Omitting the quotes will result in a syntax error.

{ name: "John", age: 30, city: "New York" }
{ name: "John", age: 30, city: "New York" }
❌ Error: Expected property name or '}' in JSON
❌ Error: Expected property name or '}' in JSON

Invalid JSON with Trailing Comma

This example shows an invalid JSON object with a trailing comma after the last key-value pair. In JSON, trailing commas are not allowed because they create ambiguity when parsing the data structure.

{ "name": "John", "age": 30, "city": "New York", }
{ "name": "John", "age": 30, "city": "New York", }
❌ Error: Expected double-quoted property name
❌ Error: Expected double-quoted property name