Paritian

Developers

JSON Validator

Says whether a JSON document is valid and, if not, exactly where it breaks.

Results

Verdict valid
Fields 2
Nesting depth 2
Size before 31 B

What this tool does

JSON is a small grammar with sharp edges: no trailing commas, no single quotes, no comments, no raw line breaks inside strings. Every one of those is legal in JavaScript and none is legal in JSON, which is why so much hand-edited JSON is subtly broken. This checks the whole document and reports the first failure with the line and column, plus the number of fields and how deeply the structure nests.

Formula

walks the JSON and stops at the first place where the grammar fails

Variables

SymbolMeaningUnit
textJSON
VDVerdict
FDFields
DPNesting depth
SBSize beforeB

Worked example

  • JSON{"nome":"Ana","marcas":[1,2,3]}
  • Verdictvalid
  • Fields2
  • Nesting depth2
  • Size before31 B

Limitations

  • The calculation runs entirely in your browser. The values you type are never sent to a server.

Frequently asked questions

Why does it say line and column?

Because "invalid JSON" on its own is useless when the document is two thousand lines long. The reader stops at the exact character where the grammar broke and reports where it was, along with what it expected to find there — a comma, a closing brace, a field name in quotes. In practice the cause is almost always one of three things: a trailing comma before a closing bracket, a single quote where JSON requires a double, or an unescaped line break inside a string.