JSON formatter and validator
Format, validate and minify JSON, with the exact position of any error.
Finding the error, not just reporting one
The useful part of a JSON validator is not "invalid JSON" — it is where. Browsers report a character offset, which is useless in a 4,000-character payload, so that offset is converted here into a line and column number you can actually navigate to.
The overwhelming majority of JSON errors are one of four things: a trailing comma after the last item, single quotes instead of double, an unquoted key, or an unescaped quote inside a string. If the reported position looks fine, check the line above it — a missing comma is usually reported at the start of the next token.
Formatting options
Pretty-printing with two or four spaces, or tabs, is the readable form for editing and for diffs. Minifying strips every unnecessary byte, which is what you want in a payload or a config that will be read by machines rather than people.
Sorting keys alphabetically is the underrated one. Two JSON objects with identical content but different key order produce a completely unreadable diff; sorting both first makes the real differences visible. It is the standard trick for comparing API responses.
What is not JSON
Comments, trailing commas, single-quoted strings, and unquoted keys are all JavaScript object syntax, not JSON. They are the most common reason a config file that "looks fine" is rejected. JSON5 and JSONC allow them; strict JSON parsers, including this one, do not.
It runs in your browser
Nothing is uploaded — which matters, because JSON pasted into a formatter routinely contains API keys, tokens and customer records. Any formatter that posts to a server has seen all of it.
Common questions
Why is my JSON invalid?
Usually a trailing comma, single quotes, an unquoted key, or an unescaped quote in a string. The error shows the line and column.
Can JSON have comments?
No. Comments are JavaScript syntax. JSON5 and JSONC allow them; strict JSON does not.
Why sort the keys?
To make two objects comparable. Identical content in different key order produces an unreadable diff otherwise.
Is my data uploaded?
No. It is parsed in your browser — which matters, since pasted JSON often contains keys and tokens.
Is there a size limit?
Only your device's memory. Multi-megabyte documents format without difficulty.