The first time this got me, the JSON looked perfect. I had pasted a config block out of a shared doc into a deploy script, run node, and gotten "Unexpected token" at position 1. I read the line five times. Character one was clearly a quote. It was, in fact, not a quote. It was U+201C, a left double quotation mark, and the parser had every right to give up.
That is the whole bug. Smart quotes are not quotes as far as JSON is concerned. JSON recognizes exactly one string delimiter: the ASCII double quote, U+0022. The curly variants your word processor, your CMS, and your phone keyboard produce are four distinct characters. Inside a string value they are perfectly legal, decorative even. The moment one sits where a structural quote belongs, the document is broken.
The four characters to know
Your text passes through a lot of hands, and smart quotes sneak in at every handoff. Word processors auto-replace straight quotes as you type. CMS rich-text editors do it on paste. Phone keyboards default to curly quotes. A dev.to writeup I ran into calls the resulting debugging session a 45-minute story, and the painful part was that everything rendered identically in the editor. Below text sizes of about 16px, U+201C and U+0022 are visually indistinguishable, so the error message is your only honest signal.
The four code points are U+2018 (left single), U+2019 (right single, the curly apostrophe), U+201C (left double), and U+201D (right double). The dangerous positions are the structural ones: the quote that should open a key, the quote that should close a string. A curly apostrophe inside "O'Brien" hurts nothing. A curly quote in place of the opening quote of a key breaks the whole document, and the reported position points at exactly that character, which is why the number never looks wrong and never looks right.
How to fix smart quotes curly quotes in your JSON parse errors
I gave up on pasting carefully, because a team never will, and the next person will copy from the wiki again. A normalize step that runs before JSON.parse holds up where discipline fails, and it is short enough to memorize.
Replace every U+2018 and U+2019 with an ASCII apostrophe, and every U+201C and U+201D with an ASCII double quote. In JavaScript that is two regex replacements on the raw text, run before parsing. Use Unicode escapes in the pattern rather than literal curly characters, because your editor and build pipeline can mangle the literal characters on save, which would be an irony too far. This normalization is safe to run on any input: valid JSON with straight quotes passes through untouched, so you can put it in the pipeline unconditionally instead of only around the cases you suspect.
One caution, because repairs are guesses. If your input has a structural curly quote and a decorative curly apostrophe in the same string, the blanket replace handles both correctly: structural ones become working quotes, decorative ones become working apostrophes. The case to watch is content where curly quotes were intentional typography, like a product name stored in a value. The replace does not hurt the parse, it just changes the character stored. If typography fidelity matters in your data, fix the generator instead: turn off smart quotes in the source document or the keyboard, and generate JSON with a serializer like JSON.stringify rather than by hand. Hand-built JSON is the root cause; the normalize pass is the guardrail.
The ordering that works in practice: generate with a serializer so the problem never appears, run the normalize pass on anything pasted or ingested from humans, and keep a hex dump handy for the one time a year something else invisible slips in. I have not needed the third step since I added the second. The 45-minute story becomes a 45-second fix, and most of that is remembering the code points.
Paste your broken JSON into the repair tool and it will flag the curly quotes and normalize them for you.
Frequently asked questions
Are curly quotes always an error in JSON?
No. A curly quote inside a string value is legal data; {"note": "It's a test"} parses fine. The error only happens when a curly quote replaces a structural quote, the ones that open and close keys and string values.
Why does the error position point at a character that looks fine?
Because U+201C and the ASCII double quote render nearly identically at small font sizes. The parser reports the position of the actual character. Inspect the code points around the reported position and the culprit shows up as 201C instead of 0022.
Should I replace smart quotes or strip them?
Replace them. Stripping a structural quote leaves a string unopened or unclosed, which is a different error. Replacing with the ASCII equivalent preserves the document's structure and its content.
Can a JSON repair tool fix smart quotes automatically?
Yes. A repair pass that maps the four curly code points (U+2018, U+2019, U+201C, U+201D) to their ASCII equivalents fixes this class of error safely. Run it before parsing on any input that passed through a word processor, a CMS, or a clipboard.
How do I stop smart quotes from getting into my JSON?
Generate JSON with a serializer such as JSON.stringify instead of writing it by hand, disable smart quotes in your editor and document tools, and add the normalize pass to your ingest pipeline as a backstop for text copied from chat, docs, and wikis.
Get one practical dev-tools guide a week: subscribe to the newsletter for new JSON guides and parser explainers.
Related reading: Fixing Unescaped Quotes in JSON String Values · How to Fix the JSON Single Quotes Error · The Trailing Comma That Breaks Your JSON · Why Is My JSON Invalid?