Utility guide
Reading a JSON syntax error, and the four mistakes behind most of them
A single missing comma, one place, is enough for a JSON parser to reject the entire document — there’s no partial success. That’s by design (it’s what makes JSON unambiguous to parse), but it means the error message is often the only clue to a problem that can otherwise take a slow visual scan to find. This tool runs the same JSON.parse every browser and Node.js use, and turns the byte offset in the error into a line number.
The four mistakes behind almost every syntax error
- A trailing comma —
{"a": 1, "b": 2,}. Valid in JavaScript object literals, invalid in JSON. The single most common cause of a “valid in my editor, rejected everywhere else” JSON file, because a JS/TS file that happens to look like JSON tolerates it. - An unquoted key —
{name: "Ada"}instead of{"name": "Ada"}. Every key in JSON must be a double-quoted string, with no exception. - Single quotes instead of double —
{'name': 'Ada'}. JSON has exactly one string delimiter, and it’s the double quote. - A missing or extra closing bracket — easy to lose track of by eye in a deeply nested document; the formatter’s indentation makes a mismatched
}or]visible immediately once the rest of the document is valid.
Format vs. minify — when each is the right output
- Format (pretty-print) — for reading, editing, diffing in version control, or pasting into documentation. The indentation is the whole point.
- Minify — for shipping. Every byte of whitespace in a JSON payload is a byte a client has to download for no benefit once a human isn’t reading it directly — API responses, config bundled into a build, anything sent over a network.
Frequently asked
Does this tool support JSON5 or JSONC (comments, trailing commas)?
No — it validates against strict JSON, the format nearly everything that consumes JSON actually requires (APIs, JSON.parse, most config loaders). JSON5 and JSONC are supersets meant for hand-edited config files specifically because they relax these rules; converting one of those to this tool’s input means stripping the comments and trailing commas first.
Why does the error line number look approximate on a one-line file?
The underlying parser reports a character offset, not a line/column pair — this tool counts newlines up to that offset to find the line. On a minified, single-line JSON document, every error will report line 1, since there’s only one line to report.
Does this tool send my JSON anywhere?
No — formatting, minifying and validating all run in your browser with the same JSON.parse/JSON.stringify built into JavaScript. Nothing is uploaded.
Can I convert this JSON to CSV?
Yes — see the CSV to JSON Converter, which converts in both directions.
