What is a JSON formatter?
A JSON formatter parses JSON text and prints it again with consistent indentation, one key per line, so it is easy to read. If the text is not valid JSON, parsing fails and the formatter reports where. Minifying does the reverse: it removes every space and line break that is not inside a string.
Features
- Pretty-print with 2 spaces, 4 spaces or tabs
- Validation with the line and column of the first error
- Minify for APIs and storage
- Sort keys A to Z to compare two documents
- Copy, or download as .json
- Runs in your browser; nothing uploaded
How to use the JSON formatter
- Paste your JSON in the box.
- Read the status line: valid, or the position of the first error.
- Choose the indent, and sort keys if you want to compare files.
- Copy the formatted or minified version, or download it.
The mistakes that break JSON most often
| Mistake | Invalid | Valid |
|---|---|---|
| Trailing comma | {"a": 1,} | {"a": 1} |
| Single quotes | {'a': 'x'} | {"a": "x"} |
| Unquoted key | {a: 1} | {"a": 1} |
| Comments | {"a": 1 // note} | Remove the comment |
| Special numbers | NaN, Infinity, 0x1F | null or a plain number |
JavaScript object literals allow most of these; JSON, as defined in RFC 8259, allows none of them.
Why it matters where JSON is formatted
API responses and config files often hold access tokens, customer emails and internal addresses. Many online formatters send what you paste to their server. This one uses the browser's own JSON.parse and JSON.stringify, so the text stays on your device; once the page has loaded it keeps working with the internet switched off.
Frequently asked questions
Is my JSON uploaded or stored?
No. It is parsed and formatted in your browser tab and is gone when you close it.
Is there a size limit?
No fixed limit. A few megabytes format quickly on a modern computer; very large files depend on your device's memory.
Does sorting keys change the data?
No. Key order has no meaning in a JSON object, so the data is the same. The order of items in arrays is kept.
Can it fix invalid JSON for me?
No. It shows where the first error is so you can fix it; guessed fixes could silently change your data.
Last updated 15 November 2026. Made by Criza Labs. Spotted a mistake? Tell us.