{}JSON FYI

Common JSON errors and how to fix them

The mistakes that cause 90% of JSON parse failures — with examples and fixes for each.

·7 min read

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 field

5. 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: 007 is invalid. Use 7.
  • No NaN, Infinity, or undefined — use null when you mean "no value".
  • No hexadecimal: 0xFF is 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 →

Frequently asked questions

Why does my JSON validator say 'unexpected token'?+

It hit a character it didn't expect at that position — usually a stray comma, missing quote, or unquoted identifier. The line and column tell you where to look.

Are duplicate keys an error?+

RFC 8259 leaves the behavior undefined; most parsers keep the last value. Treat duplicates as a bug — JSON FYI warns about them.

Related tools & guides