How it works
The tool reads your JSON character by character with a strict parser that follows the JSON standard (RFC 8259). If it finds a problem, it stops at the first error and shows:
- the line and column where parsing failed,
- a plain-English explanation of the rule that was broken,
- the line itself, with a marker under the exact position.
When the JSON is valid, it is printed again with the indentation you choose (2 spaces, 4 spaces or tabs), or with all whitespace removed (Minify). Sort keys orders the properties of every object alphabetically, which makes two JSON documents easier to compare.
Common errors and how to fix them
| Error | Invalid | Valid |
|---|---|---|
| Trailing comma | {"a": 1, "b": 2,} |
{"a": 1, "b": 2} |
| Single quotes | {'name': 'Ana'} |
{"name": "Ana"} |
| Unquoted property name | {name: "Ana"} |
{"name": "Ana"} |
| Missing comma | {"a": 1 "b": 2} |
{"a": 1, "b": 2} |
| Comment | {"a": 1 // note} |
{"a": 1} |
| Leading zero | {"code": 007} |
{"code": 7} or {"code": "007"} |
| Line break inside a string | "first ⏎ second" |
"first\nsecond" |
| Not a JSON value | {"a": undefined} |
{"a": null} |
Formatting, minifying and file size
Indentation only changes whitespace, never the data. Minified JSON is smaller and faster to send over a network; formatted JSON is easier to read and review. The line under the input shows the size before and after, so you can see how much minifying saves.