Paste JSON from an API response, a log line or a config file. It is validated and pretty-printed in your browser — nothing is uploaded.
Input · drop a file
Output
Break it yourself: the six mistakes that make JSON invalid
JSON looks like JavaScript but is much stricter. Switch on a mistake and watch where a parser stops. Only the first error is reported — parsers give up at the first thing they can’t read, which is why fixing one error can reveal the next.
✓ Valid JSON.Toggle a mistake above to see how a strict parser reacts.
How to format JSON
Paste your JSON in the left pane, or drop a .json file onto it.
Pick an indent (2 spaces is the most common style, 4 matches Python's json.dumps(indent=4)).
Press Format. The pretty-printed result appears on the right, ready to copy or download.
Formatting is also validation: the formatter has to parse your JSON before it can print it, so a malformed document is caught with the exact line and column and a plain-English reason — trailing comma, single quotes, an unquoted key.
Sort keys for cleaner diffs
Turn on Sort keys to order every object's properties alphabetically, recursively. Two JSON files with the same data but different key order then format identically, which makes the diff checker show only real changes.
What the formatter does not change
Values are never rewritten. Strings, numbers and nesting stay exactly as they were; only whitespace changes. The one exception is precision: very large integers beyond 253 are held as JavaScript numbers, so an ID like 12345678901234567890 can lose its last digits. Quote such IDs as strings in your API if you control it.
Questions
Is my JSON sent to a server?
No. Parsing and formatting run in JavaScript in your browser tab. You can disconnect from the internet after the page loads and it keeps working.
What is the difference between a JSON formatter and a JSON validator?
A validator only tells you whether the text is valid JSON. A formatter validates and then re-prints it with indentation. Both report the same errors; use the JSON validator when you just want a yes/no with an explanation.
Why does my JSON fail with “trailing comma”?
The JSON standard (RFC 8259) does not allow a comma after the last item in an object or array. JavaScript does, which is why it is such a common mistake. Delete the last comma.
My JSON is broken — can it fix it?
Yes. The JSON repair tool fixes single quotes, unquoted keys, trailing commas, comments and missing brackets automatically, and “Fix with AI” handles harder cases.
How do I pretty print JSON on the command line?
jq . file.json, or with Python: python -m json.tool file.json. In JavaScript: JSON.stringify(obj, null, 2).
How big a file can it handle?
Several megabytes is fine on a laptop. Very large files (50 MB+) are limited by your browser’s memory rather than by the tool.