Fix trailing commas, unquoted keys, invalid quotes and other common JSON syntax mistakes with a simple troubleshooting checklist.
Trailing commas and missing commas
One of the most common mistakes is leaving a trailing comma after the last item in an object or array. JavaScript sometimes allows patterns that strict JSON does not, which can confuse people copying data between formats.
The opposite problem also happens: values are listed without the comma needed to separate them.
- Valid JSON never ends the last object field with a comma.
- Every field or array item must be separated correctly.
- When in doubt, run a validator and inspect the line number.
Quotes, keys and data types
JSON requires double quotes around strings and around object keys. Single quotes, unquoted keys and smart quotes copied from rich text editors are frequent sources of errors.
Another issue is mixing up strings and native JSON values. `true`, `false`, `null`, numbers and quoted strings are all distinct.
Broken nesting and unmatched brackets
If an opening brace or bracket is not matched correctly, the whole structure becomes invalid. This often happens in long arrays, copied payloads or manually edited configuration files.
Formatting the JSON makes these problems easier to spot because indentation reveals where the structure becomes unbalanced.
Use formatting and validation together
A good workflow is to validate first, then format. Validation catches syntax problems, while formatting makes correct JSON easier to read and maintain.
If you work with APIs, logs or copied JSON snippets every day, having a small formatter nearby saves time and reduces frustration.
Watch for copy-paste artifacts from docs and rich text editors
Some JSON errors come from the source rather than the structure itself. Smart quotes, invisible whitespace and copied examples from rich text editors can introduce characters that look normal but break parsing.
If a payload seems correct at a glance yet still fails, inspect whether the problem came from copy-paste cleanup rather than the data model.
- Replace smart quotes with plain double quotes.
- Remove hidden formatting artifacts when copying examples.
- Validate immediately after pasting JSON from external sources.