JSON Parse Errors: How to Find the Real Problem

Understand missing commas, unquoted names, invalid escapes, and unexpected content with practical debugging examples.

A JSON parse error means the parser could not read the input as one valid JSON value. The reported position is where parsing failed, which is not always where the original mistake was made. Start at the reported line, then inspect the preceding property or item.

Missing comma between properties

Invalid:

{
  "name": "Alex"
  "active": true
}

The error may point at "active", but the missing comma belongs after "Alex":

{
  "name": "Alex",
  "active": true
}

Single quotes or unquoted names

{'name':'Alex'} and {name:"Alex"} are not valid JSON. Use double quotes around both the property name and string value:

{ "name": "Alex" }

Do not blindly replace every apostrophe with a double quote. An apostrophe inside a double-quoted string, such as "Alex's project", is valid content.

A missing colon

{"name" "Alex"} needs a colon between the name and value: {"name":"Alex"}. A colon connects one pair; a comma separates pairs.

Invalid escape sequences

Backslashes introduce escapes inside JSON strings. A Windows path such as "C:\users\alex" contains an invalid \u escape because the following characters are not four hexadecimal digits. Escape literal backslashes:

{ "path": "C:\\users\\alex" }

Use \n for a newline inside a string. An actual line break between the opening and closing quotes is not allowed. Unicode escapes use the form \u0041, which represents A.

Unexpected content after a value

{"id":1}{"id":2} contains two separate values, not one JSON document. If you need a list, use an array:

[{ "id": 1 }, { "id": 2 }]

Newline-delimited JSON uses a different document convention: a separate JSON value per line. This tool validates one ordinary JSON document, not a JSONL stream.

An unexpected angle bracket

If an API response begins with <, inspect the response status and content type. You may have received an HTML error page, sign-in page, or redirect response instead of JSON. Formatting the response will not correct the underlying request.

Valid syntax does not guarantee usable data

A document can parse while still having duplicate keys or the wrong field types. Duplicate keys can cause parsers to discard earlier values, so this tool warns about them without calling them a syntax violation. A JSON Schema validator is needed to check a supplied schema; this tool checks syntax only.

Try the validator, or use the syntax guide as a checklist. Fix the earliest error first; one missing delimiter can generate several later messages. The specification is RFC 8259.

Already have valid JSON? Make it readable