Common causes
1. Unquoted keys from a JavaScript object literal
JavaScript lets you write { name: "Ada" }; JSON does not. Every key must be in double quotes. If the text came from console.log, copy it with JSON.stringify(value, null, 2) instead.
{ name: "Ada Lovelace", email: "ada@example.com" }{ "name": "Ada Lovelace", "email": "ada@example.com" }2. Keys in single quotes
Single-quoted keys are valid in JavaScript and Python but not in JSON. Replace both quotes of every key and string value with double quotes.
{'name': 'Ada Lovelace', 'admin': true}{"name": "Ada Lovelace", "admin": true}3. A comment where a key should be
A // or /* comment at the start of a line inside an object is read as the start of a key. JSON has no comments; remove them or parse the file as JSONC.
{
// primary contact
"email": "ada@example.com"
}{
"email": "ada@example.com"
}4. A comma after the last property (newer wording)
Current Chrome and Node phrase this case as “Expected double-quoted property name”. The comma promises another key, so the parser finds } instead. See trailing commas in JSON.
{"email": "ada@example.com", "admin": true,}{"email": "ada@example.com", "admin": true}Frequently asked questions
Is this the same error as "Expecting property name enclosed in double quotes"?
Yes. That is Python’s wording for the same problem; see the Python version of this error for causes specific to Python dicts.
Why did older Chrome versions say "Unexpected token n"?
Before Chrome 117 and Node 20, V8 reported the first character of the bad key, so an unquoted name key gave “Unexpected token n in JSON at position N”. The newer message describes what was expected instead.
Can I keep unquoted keys?
Only if you switch format. JSON5 allows unquoted keys, single quotes and comments, and PasteKit can convert JSON5 to strict JSON in one step.