JSON Formatter
This JSON formatter indents your JSON neatly, optionally with keys sorted A–Z, so it is easy to read and diff. Only whitespace changes: every key, string and number stays exactly as you wrote it.
What you get
- Format JSON online or pretty print JSON with 2 or 4 spaces or tabs, and optionally sorted keys: a JSON beautifier that never changes your data.
- Exact to the character: 64-bit IDs are not rounded, 1.0 stays 1.0, escapes and key order are kept.
- Checked: apart from whitespace, the result is compared with your JSON token by token.
- A JSON beautifier online with syntax highlighting: JSON pretty print online that keeps every value exactly as written.
- Private and free: everything runs in your browser, nothing is uploaded, and there is no sign-up.
How each result is checked
- Your JSON is parsed strictly (RFC 8259); errors show the position.
- The formatted output is compared with your input token by token: apart from whitespace (and key order, when sorting), it must be identical, character for character.
What can't convert exactly
- Numbers keep their exact text: 1.0 stays 1.0 and a 64-bit ID like 9007199254740993 is not rounded, as it would be by tools that read the JSON into JavaScript first.
- Key order is kept as written, including keys like "2" that JavaScript objects move to the front.
- Duplicate keys are kept as written and reported: most JSON parsers keep only the last value.
Questions
Does formatting change numbers?
No. Numbers, strings (including escapes like \u00e9) and keys are copied exactly as written; only the whitespace between them changes. That includes integers above 9,007,199,254,740,991, which tools that parse JSON in JavaScript would round.
Is my data uploaded?
No. Everything runs in your browser, in a background worker. Nothing is sent to a server.
What is the difference between a JSON formatter and a JSON validator?
A formatter lays JSON out to be readable; a validator says whether it is valid and where it is not. This formatter also validates: invalid JSON is not formatted, and the error is shown with its line.
How big a JSON file can I format?
Files of several megabytes work. As a guide, a 7 MB JSON array of 50,000 records converts and is checked in a few seconds on a laptop. The limit is your browser’s memory, since nothing is uploaded.
How do I use the JSON Formatter online?
Paste your input or open a file on the left. The result appears on the right as you type, already checked; copy or download it. Nothing is uploaded: the JSON Formatter runs in your browser.