JSON Tools

JSON Validator

Validate your JSON data and find syntax errors with detailed error messages including line numbers and character positions.

JSON Input

1 lines

Validation Result

Enter JSON to validate

Common JSON Errors

Missing comma
Add comma between properties: "a": 1, "b": 2
Trailing comma
Remove comma before closing bracket: {"a": 1}
Single quotes
Use double quotes: "key" not 'key'
Unquoted keys
Quote all keys: {"name": "value"}
Undefined/NaN
JSON doesn't support undefined or NaN, use null
Comments
JSON doesn't support comments, remove // or /* */

What This Validator Actually Checks

JSON has a much smaller grammar than most people expect. This validator parses your input against the rules in RFC 8259 (the current JSON specification) and ECMA-404, which is the same grammar browsers and Node.js apply when they runJSON.parse(). If a document validates here, it will parse in JavaScript.

The six value types, and nothing else

A JSON value can only be a string, a number, an object, an array, true, false, or null. There is no date type, no comment syntax, and no undefined. Dates travel as strings, usually in ISO 8601 form, and the receiving code is responsible for parsing them back.

Number rules that catch people out

JSON numbers are stricter than JavaScript literals. Leading zeros are rejected, so 01 is invalid. A decimal point needs a digit on both sides, so .5 and 5. both fail while 0.5 passes. Hex literals, NaN, and Infinity are not part of the grammar at all. That explains why serializing them from another language often produces output that won't round-trip.

Valid JSON that still loses data

Two cases pass validation and still break things downstream. The first is duplicate keys: the specification permits them but doesn't define which one wins, and JavaScript keeps the last occurrence silently, so {"id": 1, "id": 2} parses to an id of 2. The stats panel above reports the key count, which is a quick way to spot a document with more keys than you expected.

The second is integer precision. JavaScript stores every number as a 64-bit float, so any integer above 9,007,199,254,740,991 loses accuracy on parse. Large database IDs and Twitter-style snowflake IDs hit this constantly. That is why APIs that deal in big identifiers usually send them as strings instead of numbers.

JSON, JSONC, and JSON5 are different formats

If your file came from a config directory, it may not be plain JSON. JSONC adds // and /* */ comments and is what VS Code uses for its settings files. JSON5 goes further and allows trailing commas, single-quoted strings, and unquoted keys. Both are deliberately invalid as strict JSON, so errors about comments or trailing commas usually mean the file is one of these relatives rather than genuinely broken.

One last thing worth checking if the error message makes no sense: a byte order mark at the start of a file is invisible in most editors but causes an immediate parse failure, because RFC 8259 doesn't permit one.