Formatter Validator Minifier Escape / Unescape JSON ↔ String JSON ↔ YAML JSON → CSV NDJSON / JSON Lines JSON → Types JSON ↔ XML JSON Diff JSON Patch Canonicalize (RFC 8785) Schema Validator Schema Generator JSONPath Tester JWT Decoder JSON Errors Schemas More Tools
JSONTools / JSON errors / Expecting property name enclosed in double quotes:
CPython json.loads · CPython 3.12.3

Expecting property name enclosed in double quotes: line L column C (char N)

This message comes from CPython json.loads on CPython 3.12.3. In this registry it is produced by 10 distinct mistakes. Positions in the real message vary with your input; the causes do not.

What produces this message

/* */ comments are not valid JSON

Input
{ /* note */ "a": 1 }

Exact message: Expecting property name enclosed in double quotes: line 1 column 3 (char 2)

Fix: Remove them, or switch the file to JSONC/JSON5 and use a parser for that dialect.

Comma in an empty JSON object

Input
{,}

Exact message: Expecting property name enclosed in double quotes: line 1 column 2 (char 1)

Fix: Remove the comma. An empty object is `{}`.

JavaScript object literal passed off as JSON

Input
{a: 1, b: 'two', c: [3,],}

Exact message: Expecting property name enclosed in double quotes: line 1 column 2 (char 1)

Fix: Run it through `JSON.stringify()` from JavaScript, or convert by hand: quote the keys, switch to double quotes, drop the trailing commas.

// comments are not valid JSON

Input
{
  // note
  "a": 1
}

Exact message: Expecting property name enclosed in double quotes: line 2 column 3 (char 4)

Fix: Strip the comments, or parse with a JSONC-aware reader if you control the consumer.

Numeric object key in JSON

Input
{1: "a"}

Exact message: Expecting property name enclosed in double quotes: line 1 column 2 (char 1)

Fix: Quote the key: `{"1": "a"}`.

Python dict repr passed off as JSON

Input
{'a': 1, 'b': [1, 2]}

Exact message: Expecting property name enclosed in double quotes: line 1 column 2 (char 1)

Fix: Use `json.dumps()`. If you only have the broken text, `ast.literal_eval()` reads it safely.

Single-quoted strings in JSON

Input
{'a': 1}

Exact message: Expecting property name enclosed in double quotes: line 1 column 2 (char 1)

Fix: Replace every single quote used as a string delimiter with a double quote. Watch for apostrophes inside the text — those stay as they are.

Curly (smart) quotes in JSON

Input
{“a”: 1}

Exact message: Expecting property name enclosed in double quotes: line 1 column 2 (char 1)

Fix: Replace them with straight ASCII quotes, and turn off smart quotes in whatever produced the text.

Trailing comma in a JSON object

Input
{"a": 1,}

Exact message: Expecting property name enclosed in double quotes: line 1 column 9 (char 8)

Fix: Delete the comma before the closing brace.

Unquoted object key in JSON

Input
{a: 1}

Exact message: Expecting property name enclosed in double quotes: line 1 column 2 (char 1)

Fix: Wrap every key in double quotes.

What other parsers say about the same input

If a colleague reports a different message for what looks like the same file, this is why.

Parser Message for the same inputs
GsonExpected name at line L column C path $…
Gson JsonParser (lenient off)Expected name at line L column C path $…
JSON5JSON5: invalid character ',' at 1:2JSON5: invalid character '1' at 1:2JSON5: invalid character '“' at 1:2
JSON::PPunexpected end of string while parsing JSON string, at character offset N (before "…")
Jackson ObjectMapperUnexpected character (''' (code 39)): was expecting double-quote to start field nameUnexpected character (',' (code 44)): was expecting double-quote to start field nameUnexpected character ('/' (code 47)): maybe a (non-standard) comment? (not recognized as one since Feature 'ALLOW_COMMENTS' not enabled for parser)Unexpected character ('1' (code 49)): was expecting double-quote to start field nameUnexpected character ('?' (code 8220 / 0x201c)): was expecting double-quote to start field nameUnexpected character ('a' (code 97)): was expecting double-quote to start field nameUnexpected character ('}' (code 125)): was expecting double-quote to start field name
JavaScriptCore JSON.parseJSON Parse error: Expected '}'JSON Parse error: Property name must be a string literalJSON Parse error: Single quotes (') are not allowed in JSONJSON Parse error: Unrecognized token '/'JSON Parse error: Unrecognized token '“'
Newtonsoft.Json JsonConvertInvalid property identifier character: ,. Path '', line L, position N.Invalid property identifier character: “. Path '', line L, position N.
Newtonsoft.Json JsonTextReaderInvalid property identifier character: ,. Path '', line L, position N.Invalid property identifier character: “. Path '', line L, position N.
Ruby JSON.parseunexpected token at '…'
SpiderMonkey JSON.parseJSON.parse: expected double-quoted property name at line L column C of the JSON dataJSON.parse: expected property name or '}' at line L column C of the JSON data
System.Text.Json Deserialize''' is an invalid start of a property name. Expected a '"'. Path: $ | LineNumber: L | BytePositionInLine: C.',' is an invalid start of a property name. Expected a '"'. Path: $ | LineNumber: L | BytePositionInLine: C.'/' is invalid after a value. Expected either ',', '}', or ']'. Path: $ | LineNumber: L | BytePositionInLine: C.'0xE2' is an invalid start of a property name. Expected a '"'. Path: $ | LineNumber: L | BytePositionInLine: C.'1' is an invalid start of a property name. Expected a '"'. Path: $ | LineNumber: L | BytePositionInLine: C.'a' is an invalid start of a property name. Expected a '"'. Path: $ | LineNumber: L | BytePositionInLine: C.The JSON object contains a trailing comma at the end which is not supported in this mode. Change the reader options. Path: $ | LineNumber: L | BytePositionInLine: C.
System.Text.Json JsonDocument''' is an invalid start of a property name. Expected a '"'. LineNumber: L | BytePositionInLine: C.',' is an invalid start of a property name. Expected a '"'. LineNumber: L | BytePositionInLine: C.'/' is invalid after a value. Expected either ',', '}', or ']'. LineNumber: L | BytePositionInLine: C.'0xE2' is an invalid start of a property name. Expected a '"'. LineNumber: L | BytePositionInLine: C.'1' is an invalid start of a property name. Expected a '"'. LineNumber: L | BytePositionInLine: C.'a' is an invalid start of a property name. Expected a '"'. LineNumber: L | BytePositionInLine: C.The JSON object contains a trailing comma at the end which is not supported in this mode. Change the reader options. LineNumber: L | BytePositionInLine: C.
V8 JSON.parseExpected double-quoted property name in JSON at position N (line L column C)Expected property name or '}' in JSON at position N (line L column C)
encoding/json Unmarshalinvalid character ',' looking for beginning of object key stringinvalid character '/' looking for beginning of object key stringinvalid character '1' looking for beginning of object key stringinvalid character '\'' looking for beginning of object key stringinvalid character 'a' looking for beginning of object key stringinvalid character '}' looking for beginning of object key stringinvalid character 'â' looking for beginning of object key string
hjsonFound ',' where a key name was expected (check your syntax or use quotes if the key name includes {}[],: or whitespace) at line L,1
json-bigintBad string
json_decodeSyntax error
orjsontrailing comma is not allowed: line L column C (char N)unexpected character, expected a string key: line L column C (char N)
serde_json::from_strkey must be a string at line L column Ctrailing comma at line L column C
ujsonExpected object or valueKey name of object must be 'string' when decoding 'object'Unexpected character in found when decoding object value

← All JSON parser errors

Standards this registry is checked against

Only standards bodies and peer-reviewed venues are cited. Error strings on this site are observed by executing each parser; the standards above define what the parser is reacting to.