{ } Pretty JSON & XML Try the viewer →

JSON Pretty Print: Beautify JSON Online, Free

Minified JSON saves bytes but it's miserable to read — one long line, no line breaks, every brace crammed together. Pretty-printing fixes that: clean indentation, one field per line, structure you can actually follow. Paste your JSON below and beautify it in your browser, then explore it as a table or tree.

A free online tool · Updated 29 May 2026

Open the viewer →

What "pretty print" actually means

JSON doesn't care about whitespace. These two documents are identical to a parser:

{"id":1,"name":"Alice","roles":["admin","editor"],"active":true}

…and the same thing, pretty-printed:

{
  "id": 1,
  "name": "Alice",
  "roles": [
    "admin",
    "editor"
  ],
  "active": true
}

Both are valid. But the second one is for humans — each key sits on its own line, nested arrays and objects are indented, and you can see the shape of the data at a glance. That's all pretty-printing is: re-serializing JSON with consistent indentation and line breaks so it's readable. It doesn't change a single value, just the spacing between them.

How to pretty print JSON in 3 steps

1 Paste or upload your JSON

Open prettyjsonxml.com and drop your JSON into the editor — press Ctrl+V (or Cmd+V on Mac), or click Upload a file to load a .json file straight from disk. It can be minified, messy, or hand-typed; the formatter doesn't mind.

2 Click "Format"

Hit the Format button. The viewer parses your JSON and re-prints it with two-space indentation, one field per line, and arrays expanded vertically. If the JSON is invalid, you'll get a clear error pointing at where parsing broke — usually a trailing comma or a missing quote.

3 Copy it back, or keep exploring

Select-all and copy to grab the beautified result. Or skip the copy entirely and switch to Table or Tree view to read the data instead of the text — more on that next.

Open the viewer →

Beyond formatting: table and tree views

Here's the thing about pretty-printing: it makes JSON readable, but it doesn't make it scannable. A neatly indented 800-line API response is still 800 lines you have to scroll. That's where this tool goes further than a plain beautifier.

Tree view

Tree view renders your JSON as a foldable outline — collapse the branches you don't care about, expand the one you do. It's the fastest way to navigate a deeply nested config or a sprawling response without losing your place.

Table view

When your JSON is an array of similar objects (the shape most API responses take), Table view turns each object into a row and its shared fields into sortable columns. Click a header to sort, type in the search box to filter, click a row to expand its full detail. You stop reading JSON and start scanning data. There's a full walkthrough in the guide on viewing large JSON files.

Pretty print vs. minify

Pretty-printing and minifying are opposites, and you'll want both at different times:

The viewer does both. Format expands; Minify collapses everything back to a single compact line. Round-trip as many times as you like — the data is identical either way.

Big files and broken JSON

Most online beautifiers choke on anything large or invalid. This one is built for the messy real world:

Tip: Working with XML or a SOAP envelope instead? The same Format-and-explore workflow applies — try the XML pretty printer or the SOAP response viewer.

Does my JSON get uploaded?

No. The viewer is a single HTML file with no backend and no upload endpoint. Your JSON is parsed, formatted, and rendered entirely by your browser's JavaScript engine — nothing is sent anywhere. If you're curious about the why and the how, there's a dedicated note on viewing JSON without uploading it.

Open the viewer and beautify your JSON →