Fix Invalid JSON
Most 'invalid JSON' errors come from a short list of mistakes. Paste your text in the tool below and hit Validate only to get the exact line and column, then use this checklist to fix it.
The five usual causes
Single quotes: JSON requires double quotes — change 'name' to "name". Trailing commas: remove the comma after the last item in an object or array. Comments: strip // and /* */; strict JSON has none. Unquoted keys: every key must be a quoted string. Literal newlines in strings: replace real line breaks inside a string with \n.
Fix from the reported position
The validator points to where the parser gave up. The real error is usually the token just before it — a missing comma, an unclosed bracket, or a stray quote. Fix that one spot and re-validate; JSON errors are reported one at a time.
When it is really JSON5
If your file intentionally uses comments, trailing commas, or unquoted keys, it is JSON5 or JSONC, not strict JSON. Convert it to strict JSON before sending it to a parser that only accepts the standard.
FAQ
Why does it fail when the JSON looks fine?
Most often a single quote, a trailing comma, or a missing comma between items. The reported position marks where parsing stopped, so check the token just before it.
Can I keep comments in my JSON?
Not in strict JSON. Remove // and /* */ comments, or treat the file as JSON5/JSONC and convert it before parsing.
It fixes one error and then shows another — why?
Parsers stop at the first error, so you fix and re-validate iteratively until it parses cleanly.