What this tool actually does
Every transform — format, minify, validate — runs through JavaScript's own built-in JSON.parse and JSON.stringify, the same JSON implementation your browser uses everywhere else. This tool doesn't reimplement JSON parsing; it wraps the browser's own trusted parser with a better error location, an indentation choice, and copy/download buttons — all without a network request.
Formatting vs. minifying vs. validating
Formatting (pretty-printing) adds consistent indentation and line breaks so nested structure is easy to scan. Minifying does the reverse: it strips every space, tab, and newline that isn't inside a string, producing the smallest valid representation of the same data — useful before sending JSON over a network or storing it. Validating checks syntax only, without changing the text at all.
Finding exactly where invalid JSON breaks
A common failure mode for JSON tools is reporting only "invalid JSON" with no useful location — or worse, pointing at the wrong place. This one locates the exact character offset where the syntax breaks using its own from-scratch scanner (documented in the test suite alongside this tool, cross-checked against Python's independent JSON parser on a battery of malformed strings) and converts that into a line and column:
Input with a trailing comma before the closing brace:
This reports line 4, column 1 — pointing exactly at the stray }, which is where a value was expected after the trailing comma but a closing brace appeared instead.
Frequently asked questions
Is my JSON sent to a server when I use this tool?
No. Formatting, validating, and minifying all happen in your browser using JavaScript's own built-in JSON parser — nothing you paste is ever transmitted anywhere.
What's the difference between formatting, minifying, and validating?
Formatting adds indentation and line breaks for readability. Minifying strips all unnecessary whitespace for the smallest possible size. Validating just checks whether the text is syntactically correct JSON, without changing it.
Why does the error message give a line and column instead of just "invalid JSON"?
A bare "invalid JSON" error means re-reading the whole document to find the problem. This tool locates the exact character where parsing breaks down and converts that into a line and column, so you can jump straight to the mistake.
Does this support JSON5, JSONC, or JavaScript object literals with comments?
No — this validates strict JSON per RFC 8259: double-quoted keys and strings only, no comments, no trailing commas, no unquoted keys. A common source of errors is pasting a JavaScript object literal instead of real JSON.
What counts as a trailing comma error, and why is it invalid?
A trailing comma sits right before a closing } or ] with nothing after it, like [1, 2, 3,]. JavaScript allows this in its own literals; the JSON specification does not, so JSON.parse rejects it.
Can I format very large JSON files?
Yes, up to whatever your browser's memory can comfortably hold — there's no server-side limit since nothing leaves your browser.
What are the object/array/key/value counts shown after formatting?
A quick structural summary: how many objects and arrays, how many total keys, how many scalar values, and how many levels deep the nesting goes — a fast sanity check for a large or unfamiliar payload.