← Blog ·

10 Most Common JSON Errors (and How to Fix Them)

1. Trailing commas

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

JSON does not allow trailing commas. Remove the last one.

2. Single quotes

{'name': 'Ada'}

JSON requires double quotes for both keys and string values.

3. Unquoted keys

{name: "Ada"}

Keys must always be quoted strings.

4. Comments

JSON does not support comments. Strip them before parsing or use a format like JSON5/YAML.

5. Unescaped control characters

Newlines and tabs inside strings must be escaped as \n and \t.

6. Mismatched brackets

{} is a classic mistake. Use the [JSONNeat validator — it points to the exact line and column.

7. Invalid Unicode escapes

\u00 is invalid; Unicode escapes need exactly four hex digits.

8. Numbers with leading zeros

007 is invalid. JSON numbers cannot have leading zeros (except the number 0 itself).

9. NaN and Infinity

Not valid JSON values. Use null or a custom representation.

10. BOM characters

A UTF-8 byte-order mark at the start of the file will break some parsers. Save without BOM.

Paste your JSON into JSONNeat — we'll show the line and column of any of these errors.


Try the tools: JSON Formatter · Validator · Minifier