Beautify minified or unevenly spaced JSON into readable, indented text, with your values untouched. Runs the same formatter as JSON Formatter.
What it does
JSON Beautifier turns minified or messy JSON into tidy, indented text that is pleasant to read, share and review. A one-line response from a log, an API call or a settings file becomes a layout you can scan in seconds.
It is the same formatter as JSON Formatter, with the same options and the same results: only spaces and line breaks change, never the data. Open JSON Formatter instead when the JSON is already readable and you want every file to follow one layout.
What it supports
- Minified JSON, JSON with uneven spacing and JSON with line breaks in odd places. Any valid JSON value can be the whole text.
- The limits are those of JSON Formatter, because the formatter is the same: only strict JSON is accepted, with names and strings in double quotes.
- Your data is never reordered or rewritten. Numbers such as 2.370 or 9007199254740993, string escapes and the order of names come out exactly as written.
- “Minify” is also available here to go back to a single line.
- Names repeated inside one object are all kept, with a warning, and so are unpaired surrogate escapes.
Good to know
- Beautifying changes how JSON looks, not what it means. If you only need to know whether a text is valid JSON, JSON Validator is the quicker check.
- JavaScript-style objects with unquoted names or single-quoted strings are not JSON and are refused, with the first problem located.
- A trailing comma or an invisible byte order mark (BOM) at the start is not a dead end: the tool shows what removing it would change, and applies it only when you press “Apply correction and run again”.
How to use it
- Paste the minified or unevenly spaced JSON from a log, a response or a file into the input box. Nothing runs while you type.
- Choose how airy the layout should be: “2 spaces” for a compact look or “4 spaces” for a wider one. On this page the action button is called “Format”, as in JSON Formatter, because both tools share one engine.
- Press “Format” and read the beautified text next to your input. The “Tree” below shows the same data as rows you can open and close with “Expand all” and “Collapse all”.
- Press “Copy” to paste the tidy version into a document, a ticket or a chat, or “Download” to save formatted.json.
Examples
Beautify a one-line response
A response squeezed onto one line, as it often appears in logs. Paste it and press “Format”: every level gets its own indentation, so the nesting is easy to follow.
{"user":{"id":7,"tags":["admin","dev"],"address":{"city":"Recife","zip":"50000-000"}},"active":true}{
"user": {
"id": 7,
"tags": [
"admin",
"dev"
],
"address": {
"city": "Recife",
"zip": "50000-000"
}
},
"active": true
}Names without quotes
JavaScript lets you write object names without quotes, but JSON does not. The tool stops at the first name that has none and points at it.
{name: "Ana", tags: ["a", "b"]}Unexpected character or word. JSON only allows objects, arrays, strings, numbers, true, false and null.
Line 1, column 2
Limits and privacy
Size limits
- Input: up to 2,000,000 bytes of UTF-8 text (about 2 MB). Accented letters and emoji take more than one byte each. Larger input is rejected.
- Result: also up to 2,000,000 bytes. If the complete result would be larger, the tool shows only an incomplete preview of the first 100,000 bytes, and that preview cannot be copied or downloaded.
- Nesting: up to 256 levels of objects and lists inside each other. Deeper JSON is refused because it is beyond what the tool processes.
- Time: a run that takes longer than its time limit is stopped. Try a smaller input.
Your privacy
The text you type or paste, or open from a local file, is processed locally in your browser, in a dedicated Web Worker. It is never uploaded or sent to the server (a file you open is read in your browser only), and it is not written to storage, cookies or the address bar.
“Copy” puts the result on your clipboard and “Download” saves it as a file, but only when you press the button. The file is created in your browser, so nothing is uploaded.
For the full details, see the Privacy Policy
Related tools and pages
Your text stays in the page when you switch tools in the same tab, so you can try the same text in another tool. Reloading or closing the tab ends it.