JSON Formatter and Minifier
Pretty-print unreadable JSON, or squeeze it back down to one line.
Runs entirely in your browser
Loading the tool…
Minified JSON from an API response is one enormous line. Formatting it puts every key on its own row with consistent indentation, which is the difference between skimming a payload and squinting at it.
Key order is preserved exactly as you pasted it. A formatter that alphabetises your keys silently changes the diff you were about to review. Minifying does the reverse: it strips every space and newline, typically cutting 15–30% off the payload before compression.
How to use it
- Paste JSON into the input box.
- Choose an indent width and press Format, or press Minify to compact it.
- Copy the result, or fix the reported error if the JSON is invalid.
Questions
Does formatting change my data?
No. The JSON is parsed and re-printed, so only whitespace changes. Key order, numbers and string contents come back exactly as they went in.
Why did my large numbers change?
JSON numbers beyond about 15 significant digits cannot be represented exactly as doubles. If you are handling IDs that long, transport them as strings.
What indent should I use?
Two spaces is the common default for JavaScript ecosystems and the most compact readable option; four is easier to scan on deeply nested documents.
Your data stays on your device
Everything above runs inside your browser as WebAssembly compiled from Rust. Nothing you type is uploaded, logged or stored on a server. There is no server. You can load this page once, go offline, and it still works.