JSON Formatter & Validator
Format, beautify, minify and validate JSON online for free — with exact error locations. Everything runs in your browser, so it's safe for sensitive data.
100% private — runs entirely in your browser. Your files never leave your device.
Validates and pretty-prints or minifies JSON, with the exact line and column of any syntax error. Everything runs locally in your browser — your data is never uploaded, so it’s safe for sensitive payloads.
How to use the JSON Formatter & Validator
- Paste your JSON into the input box.
- Click Format to beautify or Minify to compress.
- If it's invalid, read the exact line and column of the error.
- Copy or download the result.
What you can use it for
- Pretty-print messy API responses
- Validate JSON and find syntax errors fast
- Minify JSON to shrink payloads
- Clean config and data files privately
More free tools
Wrangling code or data?
Format, encode, hash and minify with our free developer tools — 100% in your browser.
Browse all free developer tools →Common JSON errors and how to fix them
| Error | Invalid | Valid |
|---|---|---|
| Trailing comma | {"a": 1,} | {"a": 1} |
| Single quotes | {'a': 'b'} | {"a": "b"} |
| Unquoted key | {a: 1} | {"a": 1} |
| Comments | {"a": 1 // note} | Remove the comment |
| Non-JSON values | {"a": undefined} | {"a": null} |
When validation fails, the error message tells you where parsing stopped, which is usually just after the real mistake.
Format vs. minify
Format (beautify) adds line breaks and indentation — 2 spaces, 4 spaces or tabs — so humans can read and diff the data. Minify removes all unnecessary whitespace to make the smallest payload for APIs and config files. The data itself is identical either way.
Safe for sensitive data
Parsing and formatting happen in your browser, so API responses, tokens and customer data are never uploaded. To compare two JSON files, use JSON Diff; to turn JSON into a spreadsheet, use JSON to CSV.
Frequently asked questions
What does the formatter do?
It pretty-prints JSON with your chosen indentation, minifies it to one line, and validates it — pointing to the exact line and column of any syntax error.
Is my JSON sent to a server?
No. All parsing and formatting happen in your browser, so it's safe to paste tokens, config and other sensitive payloads.
Why does it say my JSON is invalid?
Common causes are trailing commas, single quotes instead of double quotes, or unquoted keys. The error message shows exactly where to look.
Can I choose the indentation?
Yes — 2 spaces, 4 spaces or tabs.