Expecting property name enclosed in double quotes: line L column C (char N)
The parser is inside an object and expected a double-quoted key. It found something else: a single quote, a bare word, or on older Python versions a trailing comma. JSON requires keys to be double-quoted strings, with no exceptions for keys that look like identifiers.
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 Python dict printed rather than serialised
str(d) and print(d) produce single quotes. This is the single most common source of this error.
Breaks
data = str({'a': 1}) json.loads(data)Works
data = json.dumps({'a': 1}) json.loads(data) -
02 AWS or Azure CLI quoting on Windows
PowerShell and cmd handle quotes differently from a POSIX shell, so inline JSON arguments arrive at the CLI with the double quotes stripped. The reliable fix is to put the JSON in a file and pass file://params.json rather than fighting the shell.
Breaks
aws dynamodb query --key-condition-expression "{\"id\": ...}"Works
aws dynamodb query --cli-input-json file://params.json -
03 A trailing comma, on Python 3.12 and earlier
Before 3.13 a trailing comma produced this message. From 3.13 onwards it gets its own: "Illegal trailing comma before end of object". If you are following a guide that does not mention versions, this is why it may not match what you see.
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.
| JavaScript (V8) | Expected property name or '}' in JSON at position 1 (line 1 column 2) |
|---|
Questions
- Can I parse a Python dict repr without rewriting it?
- ast.literal_eval handles it safely: it evaluates Python literal syntax without executing arbitrary code, unlike eval. Then json.dumps the result if you need real JSON.
Fix it now
Paste the payload into the tool above, or go straight to the one built for this job.
Convert single quotes to JSON