Common JSON errors and how to fix them
The mistakes that cause 90% of JSON parse failures — with examples and fixes for each.
Most JSON parse failures fall into a handful of categories. Here's what to look for and how to fix each.
1. Trailing commas
{ "a": 1, "b": 2, } // ✗ invalid
{ "a": 1, "b": 2 } // ✓2. Single-quoted strings
{ 'name': 'Ada' } // ✗ invalid (single quotes)
{ "name": "Ada" } // ✓3. Unquoted keys
{ name: "Ada" } // ✗ invalid (unquoted key)
{ "name": "Ada" } // ✓4. JavaScript-style comments
{ "a": 1 /* note */ } // ✗ invalid — JSON has no comments
{ "a": 1, "_note": "..." } // ✓ use a sibling field5. Wrong literals
{ "ok": True, "x": None } // ✗ Python literals
{ "ok": true, "x": null } // ✓6. Unescaped control characters
Real newlines and tabs inside strings are illegal — escape them: \\n, \\t.
7. Numeric oddities
- No leading zeros:
007is invalid. Use7. - No
NaN,Infinity, orundefined— usenullwhen you mean "no value". - No hexadecimal:
0xFFis invalid.
Paste your JSON into the validator →
Get the exact line, column, and a fix hint in seconds — no upload, no signup.
Open JSON Validator →