Expected double-quoted property name in JSON at position N (line L column C)
The parser read a comma inside an object and then expected another property name, but found the closing brace instead. In other words: there is a comma with nothing after it. The message describes what the parser wanted rather than what you did wrong, which is why the fix is not obvious from the wording.
You may also see this written as
- trailing comma json error
- trailing comma not allowed in json
V8 rewrote most of its JSON error messages in 2022. Older wording is still what most search results show, but no current runtime emits it.
Paste your JSON and see exactly where it breaks
Nothing you paste leaves your browser. The connect-src allowlist makes that a browser guarantee rather than a promise. Check it yourself
What actually causes it
Ranked by how often each one turns out to be the answer.
-
01 A trailing comma before the closing brace
Legal in JavaScript, in JSON5 and in JSONC. Not legal in JSON. Editors that auto-format JavaScript objects add these without warning.
Breaks
{ "name": "Priya", "role": "admin", }Works
{ "name": "Priya", "role": "admin" } -
02 Two commas in a row
Usually left behind after deleting a property.
Breaks
{ "a": 1,, "b": 2 }Works
{ "a": 1, "b": 2 } -
03 A comment where a property name should be
JSON has no comments. A // line or a /* block */ inside an object produces this same message, because the parser expected a quoted key and found a slash.
The same mistake in other runtimes
The underlying problem is identical; only the wording differs. If a colleague reports one of these, they are looking at the same thing you are.
| V8, trailing comma in an ARRAY | Unexpected token ']', "[1,2,]" is not valid JSON |
|---|---|
| Python 3.13 and later | Illegal trailing comma before end of object: line 1 column 7 (char 6) |
| Python 3.12 and earlier | Expecting property name enclosed in double quotes: line 1 column 7 (char 6) |
Questions
- Why is the message different for arrays?
- Because the parser is in a different state. In an object it is waiting for a quoted key, so it says so. In an array it is waiting for a value and finds the closing bracket, which gives Unexpected token ']', "[1,2,]" is not valid JSON. Same mistake, two entirely different messages.
- Python used to give a different error for this. Did it change?
- Yes. Python 3.13 added dedicated messages: "Illegal trailing comma before end of object" and the array equivalent. On 3.12 and earlier the same input gives "Expecting property name enclosed in double quotes". Any guide that does not split by version is wrong for half its readers.
- My config file needs comments and trailing commas. What are my options?
- Use JSONC, which VS Code uses for its own settings and which allows comments and trailing commas, or JSON5, which allows considerably more. Both need a parser that supports them. Our repair tool converts either back to strict JSON.
Fix it now
Paste the payload into the tool above, or go straight to the one built for this job.
Remove it automatically