JSON (JavaScript Object Notation) is the plain-text format most APIs and config files use to represent structured data — objects, arrays, strings, numbers, booleans. It's readable by both machines and humans, but only when it's formatted well. Minified or badly-nested JSON is technically valid and completely unreadable at the same time.
What "formatting" actually changes
Formatting (also called "beautifying" or "pretty-printing") doesn't change the data at all — it only adjusts whitespace: indentation, line breaks, spacing around colons and commas. {"a":1,"b":[1,2]} and a nicely indented multi-line version are functionally identical to any program reading it; the difference is entirely for the human looking at it.
Why minified JSON is used at all
Removing whitespace shrinks file size, which matters for API responses sent over the network thousands of times a day. That's a reasonable trade-off for a server talking to a server, but a bad one for a human trying to debug something — which is why formatting tools exist as a separate, on-demand step.
Common JSON mistakes a formatter catches
- Trailing commas — valid in JavaScript object literals, invalid in strict JSON.
- Single quotes — JSON strings must use double quotes; single quotes will fail to parse.
- Unquoted keys —
{name: "Sam"}is common in JavaScript but not valid JSON; it must be{"name": "Sam"}. - Comments — JSON has no comment syntax at all, unlike JSON5 or JSONC variants some tools accept.
A good formatter doesn't just indent valid JSON — it validates first, and tells you exactly where parsing failed when it doesn't, which is usually faster than scanning by eye for a missing comma.
Try it
The JSON Formatter validates and beautifies JSON with your choice of 2-space, 4-space or tab indentation, entirely in your browser — useful for inspecting an API response or cleaning up a config file without pasting potentially sensitive data into a server you don't control.