JSON Validator
Paste JSON and find out whether it parses, with the verdict first rather than buried under the output. The page opens on a document with one deliberate mistake in it, so you can see what a failure looks like before you paste your own: a trailing comma at line 3, column 29, named as a trailing comma rather than reported as an offset. Fix it or paste over it, and the verdict turns into the key count, the nesting depth and the size.
Verdict
Not valid JSON. Line 3, column 29: Trailing comma before ]: JSON does not allow it.
Common questions
- What does the validator check?
- Everything JSON requires and nothing it does not. Structure: every object closed, every array closed, a colon after each key, no doubled or trailing commas, and only one document in the box. Values: double-quoted keys and strings, valid escapes, numbers without leading zeros, and true, false and null in lowercase. It also warns about duplicate keys, which are legal JSON that nearly every parser resolves by silently keeping the last one.
- Why does the error give a line and column instead of a character offset?
- Because a character offset is unusable in a 4,000 line file. The validator tokenises the document itself and carries the line and column of each token, so the message points at the character your editor can jump to. It also names the cause: 'Trailing comma before ]' rather than 'unexpected token'.
- Does it explain mistakes that come from another language?
- Yes, by name. True, False and None are recognised as Python and the message says so. undefined, NaN and Infinity are named as JavaScript that JSON does not have. Single quotes are called out as JavaScript string syntax. Comments are identified as JSONC, the extension editors like VS Code use in config files, with the position of the first one so you know what to strip.
- Does validating change my document?
- No. The verdict is read from your own tokens, and the indented version underneath it is printed from those same tokens rather than from a parsed copy. That is why key order survives, including integer-like keys, and why a 20 digit ID keeps all 20 digits instead of being rounded to about 16 the way parse-and-print tools round it.
- Can I get the formatted output too?
- It is already there, under the verdict. Switch Show to Formatted to put it back at the top, set the indent to 2 or 4 spaces, sort the keys A to Z, or press Minify instead to collapse the document to one line. All of it works on the same tokens, so the verdict and the output can never disagree.
- Is my JSON uploaded for checking?
- No. Tokenising, validating and formatting all run in your browser. That matters more for JSON than for most formats, because payloads routinely contain API responses, tokens and customer records that should not be pasted into someone else's server.
Exact. Key order, big integers and precision are preserved. Nothing is rounded or reordered behind your back.