JSON Unexpected Token Error

Unexpected token is one of the most common JSON errors. It usually means the parser hit a character or symbol it did not expect at the current position.

Common causes

How to fix

Examples

Bad

{"a": 1, "b": 2,}

Good

{"a": 1, "b": 2}

FAQ

What does unexpected token mean in JSON?
The parser encountered a character it did not expect at that position, often a comma, quote, or bracket issue.
How do I find the unexpected token?
Use a JSON validator; it will report the line and column of the error.

Fix it now

Try in validator (prefill this example)

Related

All tools · Canonical