JSON Prettifier
Pretty print JSON in your browser. Format messy or minified JSON into clean, indented, readable code. Strict RFC 8259, all-local, no upload.
Messy in, clean out
Same data, structured for human eyes. Beautify expands compact JSON into a line-per-key, properly indented document.
{"data":[{"id":1,"name":"Alice"},{"id":2,"name":"Bob"}]}{
"data": [
{
"id": 1,
"name": "Alice"
},
{
"id": 2,
"name": "Bob"
}
]
}What you'll use this for
Anywhere unreadable JSON shows up — API responses, log lines, copy-pasted config, compressed payloads.
API response inspection
Paste a minified response, see the structure as you'd want to read it in a doc.
Log entries
Tail a log, find a JSON line, beautify it to make sense of the fields.
Code review
Expand a fixture file so the diff highlights real changes, not whitespace.
Documentation
Paste an example response into docs with consistent indentation.
How to beautify JSON
Paste your JSON
Drop it into the left editor. Compact, single-line JSON works fine.
Pick indent
2 spaces by default. Switch to 4 spaces or tab to match your project style.
Click Beautify
Or leave auto-format on for live updates. Runs locally with JSON.parse + JSON.stringify.
Copy or download
Copy to clipboard, save as .json, or flip the Mode to Minify to compress back.
Frequently asked questions
Yes — different terms for the same operation: parse JSON, then re-emit it with whitespace + indentation. Beautifier, prettifier, pretty-print, formatter all do the same thing.
2 spaces, 4 spaces, and tab. 2 spaces is the de-facto JS / npm community default; pick whatever matches your project style.
Yes — your data never leaves your device. Uses the built-in JSON.parse + JSON.stringify.
No. Pure client-side. Uses the browser's built-in JSON.parse; your data never leaves your device.
Strict JSON only here. For JSON5 (comments, unquoted keys, trailing commas) use the JSON5 formatter.
About this beautifier
JSON beautification is a one-pass operation: parse the input into a JS object, then serialize it again with explicit indentation. The result is canonical — same structure regardless of whether the input was minified, prettified, or hand-typed.
What it does
- Indents at 2 spaces (default), 4 spaces, or tab.
- One key per line in objects, one item per line in arrays.
- Quotes stay
"(double); single-quoted input fails per RFC 8259. - Optional sort alphabetizes keys recursively (toggle).
- Minify mode flips to compact output (no whitespace).
What it doesn't do
- Comments. Strict JSON has no comments. Use the JSON5 formatter for those.
- Lossy edits. No type coercion, no key removal. The output parses back to the same object as the input.
- Schema validation. Syntactic only — use the JSON validator for structural checks against a schema.