HCODX/JSON Prettifier
100% browser-based · No data leaves your device

JSON Prettifier

Pretty print JSON in your browser. Format messy or minified JSON into clean, indented, readable code. Strict RFC 8259, all-local, no upload.

JSON input
Beautified output
Format options
Open in validator
Input size
0 B
Output size
0 B
Output lines
0
Status
Ready
Example

Messy in, clean out

Same data, structured for human eyes. Beautify expands compact JSON into a line-per-key, properly indented document.

Minified JSON
{"data":[{"id":1,"name":"Alice"},{"id":2,"name":"Bob"}]}
Beautified
{
  "data": [
    {
      "id": 1,
      "name": "Alice"
    },
    {
      "id": 2,
      "name": "Bob"
    }
  ]
}
Use cases

What you'll use this for

Anywhere unreadable JSON shows up — API responses, log lines, copy-pasted config, compressed payloads.

API response inspection

Paste a minified response, see the structure as you'd want to read it in a doc.

Log entries

Tail a log, find a JSON line, beautify it to make sense of the fields.

Code review

Expand a fixture file so the diff highlights real changes, not whitespace.

Documentation

Paste an example response into docs with consistent indentation.

Step by step

How to beautify JSON

1

Paste your JSON

Drop it into the left editor. Compact, single-line JSON works fine.

2

Pick indent

2 spaces by default. Switch to 4 spaces or tab to match your project style.

3

Click Beautify

Or leave auto-format on for live updates. Runs locally with JSON.parse + JSON.stringify.

4

Copy or download

Copy to clipboard, save as .json, or flip the Mode to Minify to compress back.

FAQ

Frequently asked questions

Yes — different terms for the same operation: parse JSON, then re-emit it with whitespace + indentation. Beautifier, prettifier, pretty-print, formatter all do the same thing.

2 spaces, 4 spaces, and tab. 2 spaces is the de-facto JS / npm community default; pick whatever matches your project style.

Yes — your data never leaves your device. Uses the built-in JSON.parse + JSON.stringify.

No. Pure client-side. Uses the browser's built-in JSON.parse; your data never leaves your device.

Strict JSON only here. For JSON5 (comments, unquoted keys, trailing commas) use the JSON5 formatter.

About

About this beautifier

JSON beautification is a one-pass operation: parse the input into a JS object, then serialize it again with explicit indentation. The result is canonical — same structure regardless of whether the input was minified, prettified, or hand-typed.

What it does

  • Indents at 2 spaces (default), 4 spaces, or tab.
  • One key per line in objects, one item per line in arrays.
  • Quotes stay " (double); single-quoted input fails per RFC 8259.
  • Optional sort alphabetizes keys recursively (toggle).
  • Minify mode flips to compact output (no whitespace).

What it doesn't do

  • Comments. Strict JSON has no comments. Use the JSON5 formatter for those.
  • Lossy edits. No type coercion, no key removal. The output parses back to the same object as the input.
  • Schema validation. Syntactic only — use the JSON validator for structural checks against a schema.
Related

Related tools