JSON formatter
Format, minify and check JSON.
Paste JSON from an API, a config file or an export. Nothing is uploaded.
- Runs right in your browser
- Free, no sign-up
More about JSON formatter
What the tool does
It takes JSON in any state, validates it and prints it back neatly indented. When something is wrong it points at the line and the column and says plainly what happened: a missing comma, a trailing comma after the last item, a key without quotes or apostrophes used instead of quotation marks.
The other direction is minification, that is the same data without spaces or line breaks. Useful in a config file, or anywhere you pay for every byte transferred.
The usual mistakes in JSON
- A trailing comma. JavaScript forgives it, JSON does not.
- Apostrophes instead of quotes. JSON knows only double quotes.
- An unquoted key. A brace with a bare key is JavaScript, not JSON.
- Comments. JSON has none; for comments you need JSON5 or YAML.
Frequently asked questions
Do you send the data to a server?
No. Parsing and formatting both run in your browser, so you can paste in a response from an internal API. Nothing is stored or logged.
Why does sorting the keys change the order from the original?
Sorting is optional and exists for comparing two files: with the keys in the same order the differences are easier to spot. It has no effect on meaning, because key order carries no significance in JSON.
Can it handle a large file?
Ordinary API responses and config files, yes. At tens of megabytes the browser starts to crawl; for files that big a command-line tool is better.