I've been working with JSON for years, and I still make the same mistakes. Not because I'm careless—because these errors are easy to miss. A missing comma here, a trailing comma there, and suddenly your entire JSON file is broken.
After fixing hundreds of JSON errors (and making plenty of my own), I've noticed the same five mistakes keep showing up. They're responsible for probably 90% of all JSON errors I've seen. Once you know what to look for, you can spot and fix them in seconds.
Let me show you the top 5 most common JSON errors, why they happen, and exactly how to fix them.
Error #1: Missing Commas
This is the champion. The most common JSON error by far. You forget a comma between properties, and everything breaks.
What it looks like:
{
"name": "John"
"age": 30,
"email": "john@example.com"
}
The problem: Missing comma after "John". JSON requires commas between all properties in an object (except the last one).
The fix:
{
"name": "John",
"age": 30,
"email": "john@example.com"
}
Why it happens: You're typing fast, you copy-paste and forget to add the comma, or you delete a property and forget the comma was there.
How to spot it: Look for two properties on consecutive lines without a comma. The validator will say something like "Expected ',' or '}'" at the line where the comma is missing.
Pro tip: Use a JSON formatter like our JSON Formatter. It'll catch missing commas instantly and tell you exactly where they are.
Error #2: Trailing Commas
The opposite problem. You add a comma after the last item, which JSON doesn't allow.
What it looks like:
{
"name": "John",
"age": 30,
"email": "john@example.com",
}
The problem: That comma after "john@example.com" is a trailing comma. JSON doesn't allow commas after the last property in an object or the last item in an array.
The fix:
{
"name": "John",
"age": 30,
"email": "john@example.com"
}
Why it happens: You're used to JavaScript, which allows trailing commas. Or you're adding properties and forget to remove the comma from the previous last item.
How to spot it: Check the last property in each object or array. If there's a comma after it, remove it.
Pro tip: Some editors highlight trailing commas. If yours doesn't, use a validator to catch them.
Error #3: Unclosed Quotes
You start a string with a quote but forget to close it. This breaks everything that comes after.
What it looks like:
{
"name": "John,
"age": 30
}
The problem: The opening quote for "name" is never closed. JSON thinks the string continues until it hits the next quote (which is actually the start of "age"), causing a syntax error.
The fix:
{
"name": "John",
"age": 30
}
Why it happens: You're typing quickly, you delete part of a string and forget the closing quote, or you have a quote inside your string that breaks things.
How to spot it: Count your quotes. Every string should have an even number of quotes (opening and closing). If you have an odd number, you have an unclosed quote.
Special case: If you need a quote inside a string, escape it:
{
"message": "He said \"Hello\""
}
Pro tip: Most code editors highlight strings. If your string highlighting looks wrong, you probably have an unclosed quote.
Error #4: Unclosed Brackets
You open a curly brace { or square bracket [ but forget to close it.
What it looks like:
{
"users": [
{
"name": "John",
"age": 30
},
{
"name": "Jane",
"age": 25
]
}
The problem: Missing closing brace } for the second user object. The array closes, but the object inside doesn't.
The fix:
{
"users": [
{
"name": "John",
"age": 30
},
{
"name": "Jane",
"age": 25
}
]
}
Why it happens: Complex nested structures are easy to mess up. You add nested objects or arrays and lose track of what's open and what's closed.
How to spot it: Count your brackets. Every { needs a }, every [ needs a ]. They should match. Most code editors have bracket matching—use it.
Pro tip: Use a JSON formatter. It'll show you exactly where brackets don't match.



