Missing comma or colon in JSON
Why 'Expected comma' and 'Expected colon' errors happen, and why the reported position is often not where the mistake is.
Open the JSON formatterWhat the error looks like
Different engines word this differently. You may see any of these:
Why it happens
- Every pair inside an object needs a colon between the name and the value, and every pair after the first needs a comma before it.
- The reported position is where the parser noticed the problem, which is the start of the next value, not the gap where the separator should have been.
- Merging two documents by hand, or deleting a line and leaving the separators behind, are the usual causes.
Example
{
"name": "My Mosaic"
"version": 2
}
{
"name": "My Mosaic",
"version": 2
}
How this tool reports it
The formatter highlights the gap where the separator belongs rather than the token after it, and offers to insert the missing comma or colon.
Paste your JSON into the formatter to see the exact line and column, or use the validator if you only need to check it.