formatjson.pro
Validate, pretty-print or minify JSON in your browser — nothing is uploaded.

JSON Pretty Print

Paste compact or messy JSON and press Pretty-print. You get it back indented with 2 spaces per level so the structure is easy to read and diff. Everything runs in your browser.

What pretty-printing does

Pretty-printing (also called beautifying) adds indentation and line breaks so each key sits on its own line and nesting is visible. This one-liner:

{"user":{"name":"Ada"},"active":true}

becomes:

{
  "user": {
    "name": "Ada"
  },
  "active": true
}

2 spaces or 4?

Two-space indentation is the most common convention for JSON and is what most formatters and editors default to; four spaces is also valid and purely cosmetic. The data is identical either way, so pick whatever your team's files already use so diffs stay clean.

It validates while it formats

Pretty-printing requires parsing the JSON first, so if the text is malformed you will get an error instead of formatted output. In other words, successfully pretty-printed JSON is also valid JSON.

FAQ

What indentation does this use?

Two spaces per nesting level, which is the most common JSON convention. The data is unchanged; only the layout differs.

Is pretty-printed JSON still valid?

Yes. Indentation and line breaks between tokens are insignificant whitespace, so a pretty-printed document parses to exactly the same value as its minified form.