The 8 most common JSON errors and how to fix them
Trailing commas, single quotes, comments, malformed numbers… what each error means and how to fix it.
Check whether JSON is valid with clear error messages.
Runs in your browser
Single quotes are used. In JSON, strings and keys must use double quotes (").
Line 2, column 3.
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.
[1, 2, 3,] is invalid: JSON doesn't allow a comma before ] or }.
{'id': 1} is invalid: strings and keys must use double quotes: {"id": 1}.
JSON literals are lowercase: true, false and null. Capitalized True comes from Python.
The standard discourages them but doesn't forbid them. Most readers keep the last value, which often causes hard-to-spot bugs.
No; it checks syntax. Schema validation depends on each project.
Trailing commas, single quotes, comments, malformed numbers… what each error means and how to fix it.