Errors you can actually act on
Browsers report JSON errors in different ways, and recent versions of Chrome don't even say where the problem is. This tool reads your JSON itself to find the first spot where it breaks, then shows the line, the column and a caret under the character.
It recognises the mistakes people make most often and tells you how to fix them:
- Trailing commas: [1, 2,] or {"a": 1,} aren't allowed in JSON.
- Single quotes: JSON strings and keys need double quotes.
- Unquoted keys: {name: 1} must be {"name": 1}.
- Missing colons or commas between items.
- Unclosed strings and line breaks inside strings (use \n).
- Invalid escapes and extra text after the end of the JSON.
Format, minify or sort
After formatting you also see how many keys the data has, how deeply it's nested and its size in bytes.
- Format (beautify): adds indentation and line breaks so nested data is easy to read.
- Minify: removes all whitespace for the smallest payload, handy for API requests and config.
- Sort keys: orders object keys A–Z at every level, which makes two JSON files much easier to diff.
Safe for real data
Plenty of online formatters send your JSON to a server. This one doesn't. Parsing and formatting happen in your browser, so API keys, tokens and customer data in your payload stay on your machine.
JSON syntax rules in one place
- Strings: always double quotes, and special characters escaped (\", \\, \n, \t).
- Keys: always strings in double quotes.
- Values: string, number, true, false, null, object or array. No undefined, NaN or functions.
- Numbers: no leading zeros (07), no trailing dot (1.), no hex (0x1F).
- No comments and no trailing commas.
- The top level can be any value, though most APIs send an object or array.
JSON vs JavaScript objects
JSON looks like a JavaScript object, but it's a stricter text format. JavaScript lets you skip quotes on keys, use single quotes, leave trailing commas and write comments; JSON allows none of these. That's why a config copied from a JS file often fails to parse.
If you need comments in config files, formats like JSONC (used by VS Code and tsconfig.json), JSON5 or YAML allow them, but a standard JSON parser will still reject them.