What this tool does
The JSON Formatter pretty-prints minified or messy JSON so it’s readable, or compacts it for transport. It can also sort keys alphabetically and report exact byte size and line count. Everything runs in your browser — nothing is uploaded.
How to use it
Paste JSON (or load the example), pick an indent (2 / 3 / 4 spaces or tab), and read the result on the right.
Input: {"id":42,"name":"devsmiths","tags":["json","tools"],"meta":{"stars":1280,"public":true},"contributors":[{"login":"ada","commits":51},{"login":"linus","commits":33}]}
Output (2-space):
{
"id": 42,
"name": "devsmiths",
"tags": [
"json",
"tools"
],
"meta": {
"stars": 1280,
"public": true
}
}Limits and edge cases
- Standard JSON only — for single quotes, trailing commas, comments or JSONP, run the JSON Repair tool first.
- Numbers beyond ±2^53 lose precision when re-serialized (JavaScript number limits). The Validator warns about this.
- Very large files (> ~1.5 MB) are processed in a background worker; the page shows a brief “processing” state. See working with large JSON files for strategies beyond the browser.
- See also: minify vs prettify JSON for the tradeoffs between the two output modes.
Frequently asked questions
- Is my JSON sent to a server?
- No. Formatting happens entirely in your browser; the page never uploads your data.
- What’s the difference between “minify” and “compact”?
- They’re the same here — “minify” removes all insignificant whitespace.
- Why did sorting keys change my data?
- It only reorders object keys (JSON objects are unordered); values are untouched. Choose “keep order” to disable it.
- Can it format JSON Lines / NDJSON?
- Not yet — paste one JSON value at a time. NDJSON support is on the roadmap.
- Does it validate too?
- It reports parse errors with line numbers, but for duplicate-key and big-number warnings use the Validator at /json/validator.