JSON (JavaScript Object Notation) is a lightweight, text-based data format used across virtually every API and configuration file on the web. When JSON is minified for transport, or comes back from an API as a single unbroken line, it becomes hard to read. Formatting re-indents it with consistent spacing so its structure — objects, arrays, nesting — is easy to scan visually.
This tool also acts as a validator: if the JSON is malformed (a trailing comma, an unquoted key, a missing bracket), parsing fails and the exact error is shown, which is usually much faster than hunting for the mistake by eye.
Minifying does the opposite — it strips all unnecessary whitespace, producing the smallest possible payload. This is useful when preparing JSON for storage or network transmission, where every byte counts.
Both Format and Minify also understand stringified JSON — a value that's itself JSON-encoded as a string, such as a log field, a database column, or a whole pasted blob that's been escaped twice. Any string that decodes to a JSON object or array, at any depth, is expanded in place rather than left as an escaped blob.
Stringify does the reverse: it takes the input JSON and re-encodes it as a JSON string literal (quotes and backslashes included), ready to paste in as a field value inside another JSON document.
What's the difference between formatting and minifying?
Formatting adds indentation and line breaks for readability; minifying strips all unnecessary whitespace to produce the smallest possible payload — both represent the exact same JSON data.
Why does it say my JSON is invalid?
Common causes are trailing commas, single quotes instead of double quotes, unquoted keys, or a missing closing bracket — all valid in JavaScript object literals but not in strict JSON.
Is my JSON data sent to a server?
No — parsing, validation and formatting all run locally in your browser using CodeMirror's JSON mode.