JSON error reference

Unexpected token in JSON

The parser found a character that is not valid at the current position.

01

Why it happens

  • Single quoted strings
  • Unquoted property names
  • Comments
  • Extra punctuation
  • HTML or another response format instead of JSON
02

Guide

Invalid
{
  'name': 'Report'
}
Valid
{
  "name": "Report"
}
03

Common parser messages

Unexpected tokenJSON.parse: unexpected characterSyntax error
04

How to fix it

  1. 1

    Check the reported line and column.

  2. 2

    Confirm the response really contains JSON.

  3. 3

    Replace single quotes and quote property names.

  4. 4

    Remove comments or unrelated text.

  5. 5

    Validate again after the smallest correction.

Jump to tool

Open broken example in JSON Repair

JSON Repair Tool