Curly (smart) quotes in JSON
Typographic quotes U+201C and U+201D instead of the ASCII double quote. Produced by word processors, chat clients, Google Docs and any editor with autocorrect enabled.
The input
{“a”: 1}{"a": 1}How to fix it
Replace them with straight ASCII quotes, and turn off smart quotes in whatever produced the text.
Like the BOM, this is nearly invisible in most fonts. If a document looks correct but fails at the first quote, check the actual code points.
What each parser reports
Every message below was captured by running this exact input through the parser named. 18 of 21 parsers rejected it; 3 accepted it.
| Parser | Exact message |
|---|---|
| CPython json.loads CPython 3.12.3 | Expecting property name enclosed in double quotes: line 1 column 2 (char 1)what this message means → |
| encoding/json Unmarshal Go go1.22.2 | invalid character 'â' looking for beginning of object key stringwhat this message means → |
| Gson Java 21.0.12 | accepted — no error |
| Gson JsonParser (lenient off) Java 21.0.12 | accepted — no error |
| hjson Node.js 22.22.2 | accepted — no error |
| Jackson ObjectMapper Java 21.0.12 | Unexpected character ('?' (code 8220 / 0x201c)): was expecting double-quote to start field namewhat this message means → |
| JavaScriptCore JSON.parse JavaScriptCore (Bun 1.4.1) | JSON Parse error: Unrecognized token '“'what this message means → |
| json-bigint Node.js 22.22.2 | Bad string |
| JSON5 Node.js 22.22.2 | JSON5: invalid character '“' at 1:2what this message means → |
| JSON::PP Perl 5.038002 | unexpected end of string while parsing JSON string, at character offset 2 (before "\x{80}\x{9c}a\x{e2}\x{80}...")what this message means → |
| json_decode PHP 8.3.6 | Syntax error |
| Newtonsoft.Json JsonConvert Newtonsoft.Json 13.0.3 on .NET 8.0.30 | Invalid property identifier character: “. Path '', line 1, position 1.what this message means → |
| Newtonsoft.Json JsonTextReader Newtonsoft.Json 13.0.3 on .NET 8.0.30 | Invalid property identifier character: “. Path '', line 1, position 1.what this message means → |
| orjson CPython 3.12.3 | unexpected character, expected a string key: line 1 column 2 (char 1)what this message means → |
| Ruby JSON.parse Ruby 3.2.3 | unexpected token at '{“a”: 1}' |
| serde_json::from_str Rust (serde_json 1.x) | key must be a string at line 1 column 2what this message means → |
| SpiderMonkey JSON.parse SpiderMonkey 115 | JSON.parse: expected property name or '}' at line 1 column 2 of the JSON datawhat this message means → |
| System.Text.Json Deserialize .NET 8.0.30 | '0xE2' is an invalid start of a property name. Expected a '"'. Path: $ | LineNumber: 0 | BytePositionInLine: 1.what this message means → |
| System.Text.Json JsonDocument .NET 8.0.30 | '0xE2' is an invalid start of a property name. Expected a '"'. LineNumber: 0 | BytePositionInLine: 1.what this message means → |
| ujson CPython 3.12.3 | Expected object or value |
| V8 JSON.parse Node.js 22.22.2 | Expected property name or '}' in JSON at position 1 (line 1 column 2)what this message means → |
What the specification says
The exact sections that govern this error. Descriptions are our paraphrase; follow the links for the normative text.
| Body | Section |
|---|---|
| IETF | A string begins and ends with a quotation mark. Any Unicode character may appear between them except the quotation mark, the reverse solidus, and the control characters U+0000 through U+001F, which the section requires to be escaped. It also fixes the escape set and the \uXXXX form. |
| Ecma International | A string is code points wrapped in quotation marks; the quotation mark, reverse solidus and U+0000–U+001F must be escaped. Table 3 fixes the escape sequences. |
| Unicode Consortium | Normatively referenced by RFC 8259 for the definition of a character. |
Other errors in this category
UTF-8 BOM before a JSON document
A byte order mark (EF BB BF) at the start of the file. Windows editors, Excel exports and PowerShell's `Out-File` add one by defau…