JSON Parser & Validator
This tool checks a document against RFC 8259, the JSON specification, and reports every problem it finds with a line and column number. Errors are underlined in the editor and listed beneath the tree; clicking one jumps the cursor straight to the offending character.
Validation is strict on purpose. Trailing commas, single-quoted strings, unquoted keys, comments, NaN and Infinity are all common in hand-written configuration and all rejected by the specification, so the parser rejects them too — and then offers to repair them.
How to use it
- Paste the document you want to check, or press Broken sample to see the diagnostics in action.
- Read the problem list: each entry gives a line, a column and a plain-English description.
- Click any problem to move the editor cursor to that exact position.
- Turn on Auto-repair to fix the common JavaScript-isms automatically, then press Apply to input to keep the repaired text.
What Smart Auto-Repair fixes
Auto-repair handles single-quoted and smart-quoted strings, trailing commas, unquoted object keys, // and /* */ comments, Python's True, False and None, JavaScript's NaN, Infinity and undefined, hexadecimal and .5-style numbers, unterminated strings, and unclosed brackets. It then reports exactly which categories it changed rather than silently rewriting your input.
It is off by default, and valid JSON is always returned byte-for-byte unchanged, so switching it on can never quietly reformat a document that was already correct.
Why repair works on tokens, not patterns
The repairer reads the document as a stream of tokens rather than applying regular expressions. That distinction is the entire point: in the value "commas, braces } and 'quotes' inside strings", a pattern-based fixer will happily strip a comma or convert a quote that is part of your data. A tokeniser knows it is inside a string literal and leaves it alone.
That property is covered by explicit tests, because it is the failure mode that makes most online JSON repair tools quietly corrupt data.
Frequently asked questions
What is RFC 8259?
- It is the IETF standard that defines JSON. It specifies double-quoted strings, no trailing commas, no comments, and a fixed set of literals — true, false and null. Most parsers in most languages follow it, which is why a document that works in your editor can still be rejected by an API.
Why is my JSON invalid when it looks fine?
- The three most common causes are a trailing comma before a closing brace or bracket, single quotes instead of double quotes, and unquoted keys. All three are legal JavaScript object syntax but none is legal JSON. Auto-repair fixes all three.
Are comments allowed in JSON?
- No. Neither // nor /* */ is part of the specification, which is why formats like JSONC and JSON5 exist as separate things. Auto-repair strips comments so the underlying document can be parsed.
Does auto-repair change my data?
- It changes syntax, not values. Strings keep their exact contents, numbers keep their value where JSON can represent it, and anything JSON cannot express — NaN and Infinity — becomes null, which is reported to you. Every change is listed above the editor before you apply it.