JSON beautifier
input.json
Paste your JSON here
or drop a .json file anywhere here
Formatted output appears here.
Three kinds of unreadable JSON
“Beautify this” usually means one of three different problems, and each has its own button.
1. Valid but minified
One long line, no whitespace. Press Format. This is the easy case — the document parses, so it only needs re-serialising with indentation. Thetree viewer is often faster still, since it lets you open only the branch you care about.
2. Valid, but the JSON is inside a string
Log aggregators, message queues, and database TEXT columns commonly hand back a JSON document that has been encoded as a JSON string. It arrives dense with backslashes:
"{\"user\":{\"id\":41,\"tags\":[\"a\",\"b\"]}}"Formatting this produces one very long string, because a string is genuinely all it is. PressUnescape instead: the outer string is parsed, the inner document is decoded, and you get real structure. Payloads encoded twice just need the button twice.
3. Not valid JSON at all
Snippets copied out of JavaScript source, Python REPL output, hand-edited config with comments, and JSONP responses are all near-JSON. Press Repair, then Format. What it handles:
{name: "ada"}→ property names get quoted{'name': 'ada'}→ single quotes become double quotes[1, 2, 3, ]→ the trailing comma is dropped// noteand/* note */→ comments are stripped{"ok": True, "x": None}→ Python literals becometrueandnull{"n": NaN}→ becomesnull, since JSON cannot express NaNcb({"a":1})→ the JSONP wrapper is removed{"a":1}{"a":2}→ newline-delimited JSON is wrapped into an array
Repair puts its result in the editor rather than applying it invisibly, so you can read the diff before you trust it.
Sorting keys for comparison
Two documents that hold the same data in a different property order are tedious to diff.Sort keys orders every object A→Z at every depth, so beautify-then-sort both sides and a text diff shows only real differences. Array order is left alone — in an array, order is data rather than formatting.
Very large documents
Above roughly 1.5 MB the editor stops re-parsing on every keystroke and waits for you to press Format, which keeps typing and pasting smooth. Beautified output over 400 KB is shown without syntax colouring, because tokenising that much text costs more than the colour is worth; thetree stays fully interactive at any size.
Common questions
Is beautifying different from formatting?
No — same operation, different name. This page exists because the input is usually messier: minified blobs, escaped strings, log lines, and near-JSON dialects. It opens with Repair one click away.
What exactly does Repair change?
It strips BOMs, // and /* */ comments, and JSONP wrappers; converts single-quoted strings and unquoted keys to double-quoted; drops trailing commas; maps True/False/None to JSON literals; converts NaN, Infinity, and undefined to null; escapes raw newlines inside strings; and wraps newline-delimited JSON into an array.
Can Repair break my data?
It rewrites the text, so review the result — that is why the repaired document lands in the editor rather than being applied silently. The two conversions that lose information are NaN/Infinity becoming null, and an unquoted bare word becoming a string. Everything else is a syntax-only change.
What if Repair cannot fix it?
You get a message saying so, and the validator error stays on screen with the line, column, and caret. Truncated documents and genuinely corrupt bytes need a human — Repair handles syntax dialects, not missing data.
The rest of the toolkit
Same engine, same privacy — every page runs entirely in your browser.
JSON formatter
Indent JSON with 2 spaces, 4 spaces, or tabs, then copy or download the result.
JSON viewer
Expand, collapse, and search a JSON tree; copy any value or its path.
JSON validator
Find syntax errors with exact line, column, and a suggested fix.
JSON minifier
Strip whitespace and see the byte savings before and after.
JSON pretty print
Readable indentation with optional deep key sorting.
JSON to CSV
Flatten an array of objects into spreadsheet rows, quoted correctly.
CSV to JSON
Parse CSV — quotes, embedded commas, any delimiter — into JSON records.
JSON to YAML
Config-ready YAML with no folded strings and no anchors.
YAML to JSON
YAML 1.2 parsing, multi-document streams, errors reported by line.
JSON to XML
Arrays repeat their tag; @keys become attributes.
XML to JSON
Entities, CDATA, and namespaces handled by the browser’s XML parser.
JSON diff
Compare two documents by path — key order and indentation are ignored.