JSON formatter & validator
Tidy it, check it, or squash it flat — and get told exactly where the problem is when it will not parse.
Your JSON
Paste anything. It is checked as you type.
Result
How to use this JSON formatter & validator
- Paste your JSON into the input box.
- Choose how you want the output formatted, including minified.
- Fix any error at the position shown, then copy or download the result.
Who it is for
For developers checking API responses, config files and JSON-LD, particularly when the data is private.
The four things that break JSON
Almost every invalid JSON file fails for one of these reasons:
| Wrong | Right | Why |
|---|---|---|
{"a":1,} | {"a":1} | No trailing commas allowed |
{'a':1} | {"a":1} | Double quotes only |
{a:1} | {"a":1} | Keys must be quoted |
{"a":undefined} | {"a":null} | There is no undefined in JSON |
JavaScript object syntax allows all four of the wrong ones, which is exactly why people write them by mistake. JSON is stricter than it looks.
Formatted or minified?
- Formatted while you are reading or editing. Indentation is what makes a nested structure comprehensible.
- Minified for anything that travels — an API response, a config embedded in a page, a schema block. The whitespace is pure weight.
On a large file, minifying often removes 20–30% of the bytes, all of it whitespace.
A note on structured data
If you are pasting a JSON-LD schema block, remember to keep the surrounding
<script type="application/ld+json"> tags out of the box — those are HTML, not
JSON, and will fail validation here even though the page is correct.
Nothing is uploaded
The parsing happens in your browser. This matters because JSON pasted into a formatter is very often an API response containing keys, tokens or customer records. None of it leaves your machine.
Common questions
How do I check if my JSON is valid?
Paste it into the box above. If it is valid it will format at once. If not, the tool shows where the error is. Trailing commas and single quotes are the most common causes.
Why does my JSON say "unexpected token"?
Nearly always a trailing comma after the last item in an object or array, or a single quote where a double quote is needed. The error message above gives you the line and column.
Can it handle very large files?
It handles a few megabytes comfortably. Beyond that your browser may slow down, since everything runs locally rather than on a server.
Does sorting the keys change the meaning?
No. Key order carries no meaning in JSON, so sorting is safe and makes two versions of the same data much easier to compare.
Is my JSON sent anywhere?
No. Nothing is uploaded, stored or logged.
Need more customers as well?
This tool is free and always will be. If you also want ads, search and follow-up that bring in customers, I offer a free 45-minute consultation for businesses in the USA, UK, UAE, Australia and India.
Book a free consultationBuilt and maintained by Premkumar Ragav, an independent performance marketing specialist. Updated November 2026.