Trailing Commas

JSON does not allow a comma after the last item in an object or array. This is the most common error for developers accustomed to JavaScript, which permits trailing commas in modern syntax. The fix is simple: remove the comma after the final element. A JSON formatter will highlight the exact position of the offending comma.

Unquoted Keys

Unlike JavaScript object literals, JSON requires all object keys to be quoted with double quotes. Single quotes are not valid — JSON strictly requires double quotes. Unquoted keys like { name: 'John' } are invalid JSON. Always use double quotes: { "name": "John" }.

Incorrect String Escaping

Strings containing double quotes, backslashes, or control characters must be properly escaped. A double quote inside a string must be written as \", a backslash as \\, and a newline as \n. A JSON formatter will identify exactly which character caused the issue.

Wrong Value Types

JSON booleans are true and false (lowercase), and null is null — not True, False, or None as in Python. Numbers must not have leading zeros. These type-related errors come from generating JSON in languages with different conventions.

Key Takeaway

A JSON formatter that validates as it formats catches all these errors instantly. Make it your first debugging tool whenever JSON fails to parse — it will pinpoint the exact location and nature of the problem.