JSON Formatter
Paste anything JSON-shaped
Indented, validated and collapsible, with the exact line and column of the first error if there is one.
JSON Formatter
Runs in your browser · nothing uploadedMore Developer tools
01 — How to use JSON Formatter
02 — Getting good results
03 — Questions
No. Parsing, formatting and validation all happen in your browser using JSON.parse and JSON.stringify. There is no server component to this tool, so nothing you paste ever leaves your device.
Comfortably up to tens of megabytes — the practical limit is your browser tab’s memory, not this tool. Very large documents (tens of thousands of nodes) may take a moment to format, since the whole tree is walked to compute the stats.
No — this formatter is strict RFC 8259 JSON only, the same grammar JSON.parse enforces: double-quoted keys, no trailing commas, no comments. If your file has any of those, it is JSON5 or JSONC, and this tool will correctly flag it as invalid.
JSON objects are unordered by the specification, so reordering keys never changes what the data means. Sorting recursively alphabetises every object’s keys while leaving array order untouched, since array order is part of the data, not incidental formatting.
04 — More about JSON Formatter
What strict JSON actually allows
JSON’s grammar, defined in RFC 8259, is deliberately small: objects and arrays as containers, strings (double-quoted only), numbers, true, false and null as values. There is no comment syntax, no trailing commas, no single-quoted strings, and no unquoted keys — all common in JavaScript object literals, none of them legal JSON. This tool enforces exactly that grammar, the same one your server’s JSON parser and every standard library enforce, so a document that formats cleanly here will parse cleanly everywhere else too.
The syntax failures that show up most often
A trailing comma after the last item in an object or array is the single most common failure, usually left behind after deleting the last property during editing. Close behind is a missing comma between two properties, an unescaped quote inside a string, or a single-quoted string copied in from JavaScript source rather than a JSON file. Each of these breaks parsing at a specific, identifiable character, which is why this tool reports the exact line and column rather than a bare "invalid JSON" — with a large payload, line and column are the difference between fixing it in seconds and reading it top to bottom.
When minifying actually helps
Minifying removes every character that exists purely for human readability — indentation, newlines, spaces around punctuation — without changing the data. That earns a real, if modest, size reduction, typically 10 to 25 percent depending on how deeply nested the original was. It is worth doing for anything served over a network or embedded in a build output; it is actively counterproductive for anything a person will read again later, since a minified file has to be reformatted before it is usable.
JSON versus JSON Lines
A single JSON document has exactly one top-level value — an object, an array, or a lone scalar. JSON Lines (also written JSONL or NDJSON) is a different, related format: one complete JSON value per line, with no enclosing array and no commas between lines, designed so that a file of a million records can be streamed and processed one line at a time rather than parsed as a single 500 MB structure. This tool validates and formats a single JSON document; a JSON Lines file needs to be split by line and each line formatted independently.
61 more tools
where this came from.
Same shell, same shortcuts, same promise: nothing leaves your browser.