Missing Comma Between Properties
JSON requires a comma between every key-value pair in an object and between every element in an array. A missing comma usually results in an 'expected comma or closing bracket' error. This often happens when adding new properties without remembering to add the separator.
Why It Matters
The JSON parser stops at the exact position where the comma is missing. Everything after that point is unparseable, even if the rest of the JSON is valid.
Common Causes
- Adding a new property or array element without inserting the comma that separates it from the previous one.
- Merging two JSON snippets and missing the comma at the seam between them.
- Hand-editing a multi-line object and overlooking that each pair needs a separator.
Code Examples
{
"name": "John"
"age": 30
"city": "Paris"
}{
"name": "John",
"age": 30,
"city": "Paris"
}How to Fix
- 1Add a comma after every key-value pair except the last one in an object.
- 2Add a comma after every element except the last one in an array.
- 3Read the error message carefully. The line number usually points to where the comma is missing.
- 4Use a JSON formatter to auto-fix comma placement.
Frequently Asked Questions
Where exactly is the missing comma?
Do the last property and last array element need a comma?
Why does the error sometimes say expected comma or closing bracket?
Check Your JSON Now
Our JSON validator detects this error automatically and shows the exact line and column.
Open JSON ValidatorCloudways · Managed Cloud Hosting
Fix this JSON error, then deploy on Cloudways managed cloud (AWS, GCP, DigitalOcean).
Free 3-day trial · 30% off 3 months + free site migration with code MIGRATE303
Related JSON Errors
Trailing Comma in JSON
Fix the trailing comma error in JSON quickly. Unlike JavaScript, JSON forbids a comma after the last element, and our examples show you exactly how.
Unexpected Token in JSON
Fix the unexpected token error in JSON fast. See why parsers fail on trailing commas, single quotes, unquoted keys, and comments, with clear examples.
Unclosed Bracket or Brace in JSON
Fix unclosed brackets and braces in JSON with confidence. Every opening curly brace or square bracket needs a matching close, and we show you exactly how.