How this formatter works

Paste JSON into the box, choose an indent, and press Format. Behind the scenes the page does exactly what your browser's own developer console does: it parses the text with JavaScript's built-in JSON.parse, then prints the result back out with JSON.stringify using the spacing you picked. Minify runs the same parse and prints with no spacing at all. Validate stops after the parse — if the text parses, it is well-formed JSON; if it does not, the parser's own error message is shown instead of a guess. The counts under the result — keys, objects and arrays — are worked out by walking the parsed data one level at a time. Nothing is sent to a server: the parsing, counting and printing all happen in this tab, on your device.

Format or minify — which do you need?

Formatting (pretty-printing) adds line breaks and indentation so a human can follow the nesting: which keys belong to which object, where each array starts and ends. Minifying strips every optional space and newline back out, producing the smallest faithful copy of the same data. Reach for the formatted view when you are reading, debugging, reviewing or sharing JSON with another person. Reach for the minified view when the JSON is stored or sent: config files, request payloads and anywhere bytes count.

Reading the error message and position

When parsing fails, the browser reports the point where it gave up. The position counts characters from the very start of the text, and many browsers also give the line and column; this page shows whatever your browser provides. The important habit is to look slightly before that point. A missing comma is the classic case: the entry itself looks fine, and the parser only realises something is wrong when it runs into the next key. Work backwards from the reported position and check three things — is the previous value complete, is there a comma separating it from what follows, and are all quotes and brackets closed in the right order? Nine times out of ten, one of those three is the whole problem.

The five mistakes behind most invalid JSON

Almost every parse error comes down to one of these. JSON is stricter than the JavaScript object syntax it resembles, and stricter than most people expect:

MistakeWhat JSON requires
A trailing comma after the last itemRemove it — JSON allows no trailing commas
Single quotes around stringsUse double quotes for every key and string
Unquoted property namesWrap every key in double quotes
Comments inside the dataJSON has no comments — remove // and /* */ notes
Values like undefined, NaN or InfinityUse null, or a real number in standard notation

Two honest limits worth knowing

First, numbers. JavaScript reads every JSON number as a double-precision float. Whole numbers up to 2^53 (9,007,199,254,740,992) are represented exactly; beyond that, a value can lose precision when it is parsed and printed back — an 18-digit ID can return with its final digits changed. If an exact large number matters, carry it in quotes as a string, as many APIs already do with IDs. Second, duplicate keys. If the same key appears twice in one object, JSON.parse keeps the last value and silently drops the earlier one — valid syntax, but rarely what the author intended. And remember: a successful parse proves only that the syntax is well-formed — not that the data has the fields or types your application expects. That is schema validation, a separate step this tool does not perform.

Your JSON stays in your browser

API responses and config files tend to contain exactly the things you least want on a stranger's server — access tokens, email addresses, internal URLs. Nothing you paste here is uploaded, transmitted or stored; the whole job runs in this tab. The flip side is that the page keeps nothing for you either: refresh or close the tab and both boxes are empty, so copy or download anything you need before you leave.