Published January 2026 • 7 min read
JSON is strict about its syntax. A single misplaced comma or missing quote can break an entire parse operation. Here are the ten most common JSON errors, what causes them, and exactly how to fix each one.
One of the most frequent mistakes — especially for developers coming from JavaScript, which allows trailing commas in arrays and objects.
JSON requires double quotes for both keys and string values. Single quotes are not valid.
Unlike JavaScript objects, JSON keys must always be strings enclosed in double quotes.
JSON does not support comments. Many developers try to add them — this will always cause a parse error.
Every property in an object and every item in an array must be separated by a comma.
Every opening { or [ must have a matching closing } or ].
JSON only accepts null, not JavaScript-specific values like undefined, NaN, or Infinity.
Certain characters inside strings must be escaped with a backslash: \", \\, \n, \t, etc.
Keys must always be strings. Using a bare number as a key is not valid JSON.
A valid JSON document has exactly one root element. Having extra characters after it will cause a parse failure.
If you are struggling to find the error in your JSON, paste it into the JSON formatter tool — it will show you exactly where the parse error occurs.