Skip to content
LocalOnly

JSON Beautifier

Stable

Turn minified or tangled JSON into clean, readable, well-indented text.

Everything is processed locally in your browser

The JSON Beautifier is for reading JSON that was never meant to be read: a minified API response, a one-line log entry, or a payload copied from browser DevTools. Paste it and the same document comes back with consistent indentation and line breaks, so you can follow the nesting and find the field you need. It uses the same parser and formatter as the JSON Formatter, so it also reports a syntax error instead of guessing.

How to use it

  1. 1

    Paste minified JSON

    Drop in the single-line or poorly formatted JSON you want to make readable.

  2. 2

    Beautify

    The tool re-indents the document into a clean, consistent structure.

  3. 3

    Scan the output

    Review the expanded JSON with clear nesting and line breaks.

  4. 4

    Reuse it

    Copy the readable version into your editor, docs, or a bug report.

Examples

Minified blob to readable JSON

Input

{"event":"signup","user":{"id":7,"plan":"pro"},"ts":1719800000}

Output

{
  "event": "signup",
  "user": {
    "id": 7,
    "plan": "pro"
  },
  "ts": 1719800000
}

How JSON beautification works

Beautify, format, pretty-print: one operation, three names

It is worth being straightforward about this, because the terminology causes real confusion. Beautifying JSON, formatting JSON and pretty-printing JSON are the same operation: parse the document, then write it back out with line breaks and indentation. There is no technical difference between them, and no tool anywhere produces different output for one term versus another.

The three names come from different traditions. "Pretty-print" is the oldest, borrowed from Lisp and used in `JSON.stringify`'s third parameter and in Python's `json.tool`. "Beautify" arrived from the JavaScript tooling world, where jsbeautifier and its descendants popularised the word. "Format" is what editors and language servers call it, and it is the term Prettier and the VS Code command palette use.

So if you searched for a beautifier and landed here, you are in the right place - and so would you be at the JSON Formatter. This page leans towards the readability side of the job: choosing an indentation style and knowing when indentation alone is not going to make a document readable.

Choosing an indentation width, and why it is not just taste

Two spaces is the effective default of the ecosystem. Prettier uses it, npm writes `package.json` with it, and most style guides for JSON and JavaScript settle there. If you have no reason to choose otherwise, choose two - it keeps deeply nested documents from marching off the right edge of the screen.

Four spaces is more readable at shallow depths and is conventional in Python, C# and Java projects, where surrounding code already uses it. The cost shows up in nesting: at six levels deep, four-space indentation has consumed 24 columns before any content appears, which on an 80-column diff view leaves very little room.

Tabs have one genuine advantage that spaces cannot match: each reader controls the visual width. A developer who wants a compact view sets tab width to 2, a colleague who needs more separation sets 8, and the bytes on disk are identical. That also makes tabs the accessible choice, since readers using large fonts or screen magnification can reduce indentation without editing the file. The trade-off is that tab handling still varies across tools and web views.

Whichever you pick, the value of consistency exceeds the value of the choice. Mixed indentation inside one repository produces diff noise on every touched file, which is why an `.editorconfig` at the project root is worth more than any individual preference.

When indentation is not enough

Beautifying has a ceiling. A 40,000-line formatted document is not meaningfully more usable than the minified original - you have swapped one navigation problem for another. When you find yourself scrolling rather than reading, indentation has stopped being the bottleneck.

Three things help beyond that point. Collapsing branches, so you can see the shape of a document without its contents, which is what the JSON Tree Viewer provides. Querying, so you extract the handful of fields that matter instead of reading around them - the JSON Path tool. And summarising, so you learn the depth, key counts and type distribution before deciding where to look, which is the JSON Statistics tool.

There is also a document-design point worth making. If a payload is only legible after beautifying, that is often a hint about the payload rather than about your tools: very deep nesting, arrays of thousands of near-identical objects, or keys carrying encoded data are all readability problems that formatting can only paper over.

Troubleshooting common errors

Indentation looks wrong after pasting into another editor

Why: Tab-indented output being rendered at a different tab width, or an editor converting tabs to spaces on paste.

Fix: Re-run with space indentation if the destination is unpredictable. Spaces render identically everywhere, which is precisely their advantage.

The beautified file creates a huge diff in version control

Why: The repository previously used a different indentation width, so every line has changed.

Fix: Commit the reformat as its own change with no functional edits, and add an `.editorconfig` so it does not recur. Many teams also add the commit to `.git-blame-ignore-revs`.

Beautifying fails on a config file that your editor opens happily

Why: The file is JSONC - JSON with comments. `tsconfig.json`, `.eslintrc.json` and VS Code settings all commonly contain comments.

Fix: Strip the comments before beautifying, and keep the annotated file as your source of truth. Comments cannot survive a parse-and-reserialize round trip.

Non-Latin characters render as escape sequences

Why: The source document had them escaped as `\uXXXX`, or the destination is displaying them without UTF-8 encoding.

Fix: This tool resolves escapes to real characters. If they reappear escaped, the issue is the encoding where you pasted the result, not the beautifier.

Limitations

  • Comments are removed. JSONC and JSON5 files will lose their annotations.
  • Line length is not wrapped - a single long string value stays on one long line, because breaking it would change the data.
  • Blank lines cannot be inserted between logical groups; JSON has no way to record where they belong.
  • Key order is preserved as-is. Alphabetical ordering is a separate operation.
  • Beautifying does not make an enormous document navigable - it only makes it indented.

Frequently asked questions

Learn more

Command Palette

Search for a tool or command