JSON guide

JSON Parser Error Unexpected Token

Understand and fix unexpected token errors from JSON.parse and strict JSON parsers.

Open AI JSON Repair

How to do it

  1. Paste the JSON that caused the unexpected token error.
  2. Repair common syntax problems such as comments, trailing commas and single quotes.
  3. Validate the repaired JSON before parsing again.

Recommended tool

Related guides

FAQ

What causes unexpected token in JSON?

The parser found a character that strict JSON does not allow at that position.

Are comments allowed in JSON?

No. Comments are common in JavaScript objects but invalid in strict JSON.

How do I fix the error?

Repair the syntax, then validate the result with JSON Validator.