JSON's syntax is strict on purpose — it makes the format unambiguous for machines to parse, but that means one stray comma can break an entire file. Here are the five errors that show up most often, and how to spot them.
1. Trailing commas
Unlike JavaScript object literals, JSON does not allow a comma after the last item in an array or object.
{ "a": 1, "b": 2, }
That trailing comma after 2 is invalid JSON. Remove it.
2. Unquoted or single-quoted keys
Every key in a JSON object must be a string wrapped in double quotes — not single quotes, and not bare identifiers.
{ name: 'Ali' } ❌
{ "name": "Ali" } ✅
3. Using single quotes for string values
String values must also use double quotes. Single-quoted strings are a common carryover from JavaScript or Python, but JSON doesn't accept them.
4. Mismatched or missing brackets
A missing closing } or ] — especially in deeply nested structures — is one of the hardest errors to spot by eye. A formatter that indents your JSON and points at the exact line/column of the failure saves a lot of time here.
5. A trailing comment
JSON has no concept of comments (// like this or /* like this */). If your JSON came from a hand-edited config file that supports comments (like JSONC), strip them before validating as strict JSON.
The fastest way to find the error
Rather than scanning by eye, paste the JSON into a validator that reports the exact line and character of the failure. Fix that one spot, re-validate, and repeat — most "broken" JSON files have just one or two real syntax errors, even if they look intimidating at a glance.