Skip to content
TrySitePrice

JSON formatter and validator

Paste JSON and get it formatted, measured and checked. Two things get reported that a formatter is not obliged to notice: a key that appears twice in the same object, named with its path, because a parser keeps one value and drops the other without an error; and how deeply the document nests. When it does not parse, the line and column are reported with the offending line quoted back — which is usually enough to find the trailing comma without reading the whole file.

Parsed by your browser's own JSON engine, in this tab. Nothing is sent anywhere.

Indent
Paste JSON above. A parse failure reports the line and column your browser stopped at, and the line itself is quoted back — which is usually enough to spot the trailing comma or unquoted key behind it. A file that parses is measured instead: duplicate keys named with their path, the deepest nesting, and the counts of keys, values, arrays and objects.

Questions about JSON validity

01My JSON is valid but the duplicate key warning fired. What does that mean?

It means the same key appears twice in one object. Every mainstream parser accepts it and keeps the last value, dropping the earlier one with no error — a few keep the first instead, and a strict parser may refuse the document outright, so the one thing you cannot rely on is which value survives. The file is valid either way, and also does not mean what it looks like. That silent overwrite is worth seeing, which is why it is reported as a warning rather than ignored.

02Why do trailing commas fail?

Because JSON does not allow them, even though JavaScript does. The same applies to comments, single-quoted strings and unquoted keys: all four are everyday JavaScript and none of them is JSON. A file that works when pasted into a console can still be rejected by every JSON parser.

03Is my data sent anywhere?

No. Parsing uses your browser's own JSON engine in this tab. Nothing is posted, logged or stored, which is the point of doing it client-side for data you may not be able to paste into a hosted service.

04What counts as deepest nesting?

The number of containers you pass through to reach the most deeply buried value. It is reported because deep nesting is where schema mismatches hide, and because some parsers and databases impose a depth limit that a flat-looking document can quietly exceed.

Related checks

For JSON that is specifically structured data, check it against the vocabulary with the schema markup validator, or against the product snippet rules with the product schema validator.