What this tool does
The JSON formatter expands a minified API response into readable indentation — or squeezes formatted JSON back into one line.
It can also sort keys alphabetically, which makes diffing two JSON files much easier. Everything runs in your browser.
A common workflow: save a minified API response to a file, drop it in to format it, inspect the structure, then minify it again before pasting into code. Sorting keys helps a lot here — when repeated captures differ only in key order, sorting first leaves just the real value changes. Note that formatting changes byte counts without changing meaning, so any checksum will change along with the whitespace.
How to use
- Paste JSON or drop a .json file Pasting is quickest; files can be up to 20MB and must be UTF-8 encoded.
- Choose indentation 2 spaces reads best, 4 spaces matches some code styles, and “minify” produces the smallest output.
- Copy or download the result If parsing fails you get the location of the error so you can fix the source.
FAQ
Will numeric precision change?
No. Parsing and serializing preserve numbers, though integers beyond the safe range are better stored as strings.
Does it support JSON with comments?
No. Standard JSON forbids comments (that is JSON5/JSONC) — remove them first.
Does sorting change array order?
No. Sorting only applies to object keys; array order is semantic in JSON and is preserved.
Can it convert to CSV?
No. JSON to CSV needs handling of nested structures and is a separate tool.
What about files larger than 20MB?
Files above the limit are rejected. Split them with a command-line tool such as jq, or process them with a streaming script.
Is my data uploaded?
No — all processing happens inside your browser.
Limits
Up to 20MB; standard UTF-8 JSON only.
No JSON5 or JSONC comments, no schema validation, no JSON-to-CSV conversion.