What the error means
After a complete "key": value pair inside an object, JSON permits exactly two continuations: a comma, which announces another pair, or a closing brace, which ends the object. Expected ',' or '}' after property value in JSON means the parser finished reading a value and the very next non-whitespace character was neither.
In the example, the value "Ada" is complete at the end of line two. Line three begins with "role". That is a string, not a comma or a brace, so the parser stops and reports the position of the opening quote on line three — one line after the actual mistake, which is the missing comma at the end of line two.
Why it happens
- A missing comma between properties. Far and away the usual cause. It happens when a property is added by hand at the end of an object and the previous line's comma is forgotten, or when lines are reordered.
- A bare word after a value.
"active": true yesor a stray identifier from an incomplete edit. - A value that was meant to be a string but is not quoted, such as
"env": production. The parser readsproductionas an error at thep, but in some engines it first consumes what it can and reports this message at the next token. - A comment after a value on the same line.
- A number followed directly by text, for example
"port": 5432px.
How to fix it
- Paste the document into the converter above. Note the line the error names, then look at the end of the line before it.
- If that line ends with a value and no comma, add the comma. This resolves most cases.
- If the reported line contains a bare word or a unit after a number, quote the whole value or remove the extra text.
- Convert again. The YAML output makes each property visible on its own line, which confirms nothing merged unexpectedly.
The corrected example:
{
"name": "Ada",
"role": "admin"
}
If it still fails
- The same message can appear when an object is closed with
]instead of}because brackets were mismatched several lines earlier. Match every{to a}and every[to a]working outward from the error. - If you are assembling JSON with string concatenation in code, this error almost always means a missing
,in the template. Use the language's JSON serializer instead of building the text by hand. - JSON Repair inserts missing commas between properties automatically when the structure is unambiguous.
Related errors
Expected double-quoted property name in JSON
Wrap every key in double quotes and delete any comma that sits directly before a closing brace; JavaScript object syntax is not JSON.
Unexpected token } in JSON
Delete the comma after the last property or array item. JSON allows no trailing commas, so the parser reaches } while still expecting another value.