Common JSON errors
What each parse error actually means, why it happens and how to fix it. Every page shows the wording used by each browser engine, because they all phrase it differently.
Open the JSON formatter- Unexpected token in JSON SyntaxError: Unexpected token < in JSON at position 0
- Unexpected end of JSON input SyntaxError: Unexpected end of JSON input
- Trailing commas are not allowed in JSON SyntaxError: Unexpected token } in JSON at position N
- JSON strings must use double quotes SyntaxError: Unexpected token ' in JSON at position N
- JSON property names must be quoted SyntaxError: Unexpected token n in JSON at position 1
- JSON does not support comments SyntaxError: Unexpected token / in JSON at position N
- NaN and Infinity are not valid JSON SyntaxError: Unexpected token N in JSON at position N
- JSON uses true, false and null SyntaxError: Unexpected token T in JSON at position N
- Invalid numbers in JSON SyntaxError: Unexpected number in JSON at position N
- Unescaped characters in a JSON string SyntaxError: Bad control character in string literal in JSON at position N
- Duplicate property names in JSON No error is raised by JSON.parse
- Invisible characters breaking your JSON SyntaxError: Unexpected token in JSON at position 0
- Missing comma or colon in JSON SyntaxError: Expected ',' or '}' after property value in JSON at position N
Nothing here matches that message. Paste the JSON into the formatter and it will name the problem and the exact line and column.