JSON Formatter and Viewer Online

Minified JSON saves bytes on the wire, but it is miserable to read: one long line with no line breaks, where nested objects and arrays run together. This formatter re-indents that string into a clean, hierarchical layout so you can actually see the structure — which keys belong to which object, how deeply arrays nest, and where a value sits in the tree.

It also doubles as a quick validity check. Well-formed JSON reformats instantly; malformed JSON stops at the first problem, so a trailing comma, a single-quoted string, or an unquoted key surfaces right where it breaks. Everything runs in your browser — the JSON you paste never leaves your machine, which matters when it is an API response or config that contains secrets.

How to use it

  1. Paste your JSON — minified, messy, or already partly formatted — into the input.
  2. Choose an indentation width (2 or 4 spaces) to match your project's style.
  3. Read the formatted output, using the indentation to trace nested objects and arrays.
  4. If the input is invalid, note where formatting stops and fix the syntax there.

Common use cases

Examples

Minified object to readable form

Input {"id":42,"tags":["a","b"],"ok":true}

Output { "id": 42, "tags": [ "a", "b" ], "ok": true }

Each key lands on its own line, and the array elements indent one level deeper.

Spotting an error

Input {"name": "Ada", "age": 36,}

Output Invalid JSON: trailing comma before }

JSON forbids a comma after the last property; remove it and the object formats cleanly.

Frequently asked questions

Is my JSON uploaded to a server?
No. Formatting happens entirely in your browser, so the data never leaves your device — safe for API payloads and config with secrets.
Should I use 2 or 4 spaces?
Either is valid — pick what your codebase uses. Two spaces keeps deeply nested JSON narrower; four makes shallow structures easier to scan.
Why does formatting fail on my input?
The input is not valid JSON. Common causes are trailing commas, single quotes instead of double, unquoted keys, or a missing bracket. The output points to where parsing broke.
Does prettifying change my data?
No. It only adds whitespace and line breaks. The keys, values, and structure are identical — just laid out for humans to read.

Related tools