JSON validator

Check whether JSON is valid with clear error messages.

Runs in your browser

What it does: JSON validator

Check whether text is valid JSON and, if it isn't, find out exactly where and why. Instead of a cryptic “Unexpected token”, you see the line highlighted and an explanation such as “there's an extra comma before the closing bracket” or “keys must be in double quotes”.

If the JSON is valid, you'll see its root type, depth, number of keys and size, plus warnings about duplicate keys or numbers that would lose precision.

How to use it

  1. Paste your JSON or load one of the examples.
  2. Validation runs as you type.
  3. Fix the highlighted error and repeat until you see “The JSON is valid”.

Examples

Trailing comma

[1, 2, 3,] is invalid: JSON doesn't allow a comma before ] or }.

Single quotes

{'id': 1} is invalid: strings and keys must use double quotes: {"id": 1}.

Limits, formulas and assumptions

  • Detected errors: trailing or missing commas, missing colons, single quotes, unquoted keys, comments, invalid escapes, malformed numbers, literals such as True, undefined or NaN, and extra content after the JSON.
  • Warnings (the JSON is still valid): duplicate keys and integers above 2^53, which JavaScript can't represent exactly.
  • No code is executed: the text is only parsed.

Frequently asked questions

Why isn't True valid?

JSON literals are lowercase: true, false and null. Capitalized True comes from Python.

Are duplicate keys an error?

The standard discourages them but doesn't forbid them. Most readers keep the last value, which often causes hard-to-spot bugs.

Does it validate against a JSON Schema?

No; it checks syntax. Schema validation depends on each project.

Related guides