Smart Quotes vs Straight Quotes: Code Points, the Word Setting, and Why JSON Breaks
What smart (curly) quotes are, their Unicode code points, how to stop Word converting them, and why they break JSON, CSV, SQL and shell commands, with a fix.
Every document you write, every chat answer you copy and most web pages you read use curly quotes. Every programming language, config file and data format expects straight ones. The two look nearly the same on screen and are completely different characters to a computer, which is why a command copied from a document fails, a JSON file will not parse, and a CSV import puts a stray character in front of a name. This page explains the difference, shows the exact code points, tells you how to stop Word and Google Docs curling them, and points to a converter for text you already have.
The six characters
| Character | Code point | Name | Typed by |
|---|---|---|---|
" | U+0022 | Quotation mark (straight double) | Your keyboard; code editors |
' | U+0027 | Apostrophe (straight single) | Your keyboard; code editors |
| “ | U+201C | Left double quotation mark | Word, Docs, chat assistants, most websites |
| ” | U+201D | Right double quotation mark | Same |
| ‘ | U+2018 | Left single quotation mark | Same |
| ’ | U+2019 | Right single quotation mark, also the typographic apostrophe | Same |
There are more in the family. German-style low quotes „ (U+201E), French guillemets « » (U+00AB, U+00BB), the prime and double prime ′ ″ used for feet and inches, and the modifier letter apostrophe ʼ (U+02BC) all get used as quotes in copied text and all cause the same failures. The converter handles all of them, not just the four common curly ones.
Why they exist
Straight quotes are a typewriter compromise. A typewriter had one key for both opening and closing quotes to save space. Printed books had always used distinct opening and closing marks, and when word processors arrived they restored that: type a straight quote and the software replaces it with the correct curly one depending on whether a space came before it. That is the AutoCorrect feature in Word, the smart quotes preference in Google Docs, and the default behaviour of the text engines on macOS and iOS. Chat assistants produce curly quotes for the same reason, because they were trained on published text where curly quotes are the norm.
What breaks
JSON
A JSON parser recognises a string only when it starts with U+0022. Paste {“id”: 1} from a document into a config file and every parser reports an error at the first character inside the brace, usually "Unexpected token" or "Expecting property name enclosed in double quotes".
CSV
CSV uses straight double quotes to wrap values that contain commas or line breaks. A curly quote is not recognised as a wrapper, so a value like “Smith, John” is split at the comma into two columns, and each half carries a curly quote as part of its data. Lookups against the clean version of the name then fail.
SQL
String literals in SQL are delimited by straight single quotes. WHERE name = ‘Smith’ produces a syntax error in most databases because the parser sees an unknown token. Worse, in databases that accept the curly character as part of an identifier, the query can run and return nothing, with no error at all.
Shell commands and code
A command copied from a blog post or a chat answer, such as git commit -m “Fix login”, fails in a terminal because the shell does not treat the curly quote as quoting, so “Fix and login” become two separate arguments. Python, JavaScript and most other languages reject a curly quote outside a string as an invalid character, and Python names it explicitly: SyntaxError: invalid character '“' (U+201C).
Search and matching
Two strings that differ only in the type of quote do not match. A search for don't does not find don’t. A spreadsheet lookup of a product name with a curly apostrophe does not match the same name typed with a straight one.
Stop Word and Docs converting them
If you write code, commands or data in a word processor, or paste them into one to share, turn the automatic conversion off.
Microsoft Word
- Go to File, Options, Proofing, then click AutoCorrect Options.
- On the AutoFormat As You Type tab, untick "Straight quotes" with "smart quotes".
- On the AutoFormat tab, untick the same option so that a later AutoFormat run does not re-curl them.
This does not change quotes already in the document. To fix those, keep the setting off and use Find and Replace with " in both the Find and Replace boxes; Word replaces both curly variants with the straight one. Do the same with '. With the setting on, the replacement would be curled again as it is inserted.
Google Docs
Go to Tools, Preferences, and untick Use smart quotes. Docs has no code for the curly characters in Find and Replace, so paste a real curly quote into the Find box, copied from the document, and a straight one into Replace.
macOS and iOS
On a Mac, System Settings, Keyboard, Text Input has a Use smart quotes and dashes switch. On iOS it is under Settings, General, Keyboard, Smart Punctuation.
Fix text you already have
For a snippet, a config file or a page of copied text, paste it into the Smart Quotes to Straight Quotes converter. It replaces all the curly variants, guillemets and primes with " and ', counts what it changed, and touches nothing else. Tick the option for other typographic characters to also convert the em dash to a hyphen and the non-breaking space to a normal space, since those two are the next most common reason a pasted command or query fails.
If the text is an AI answer with markdown, emojis and invisible characters as well, the AI Text Cleaner straightens the quotes as part of its typography option and handles the rest in the same paste. And if the converter reports zero changes but the code still fails, the culprit is probably a character you cannot see; check it with the hidden character checker.
Which to use where
- Prose in a document, email or post: curly quotes are correct. Leave the setting on.
- Anything a computer will parse: code, JSON, YAML, CSV, SQL, shell commands, URLs, config files, regular expressions. Straight quotes only.
- Documentation that contains code: use a code block or a monospace style, which Word and Docs exclude from AutoCorrect, or turn the setting off while writing.
- Text headed for a spreadsheet: straight quotes, because a curly apostrophe in a name or code breaks matching. See copying a ChatGPT table into Excel for the rest of that cleanup.
Frequently asked questions
What is the difference between smart quotes and straight quotes?
Straight quotes are the two characters on your keyboard, " (U+0022) and ' (U+0027). Smart quotes are four typographic characters that curl towards the text they enclose: “ ” (U+201C, U+201D) and ‘ ’ (U+2018, U+2019). Word processors and chat assistants insert the curly ones automatically; programming languages and data formats only understand the straight ones.
Why does my JSON fail with a smart quote in it?
JSON strings must be delimited with U+0022, the straight double quote. A curly quote is just an ordinary character to the parser, so {“name”: “x”} is read as an object starting with a stray character and fails with an unexpected-token error at position 1.
How do I turn off smart quotes in Word?
Go to File, Options, Proofing, AutoCorrect Options, then the AutoFormat As You Type tab, and untick "Straight quotes" with "smart quotes". Untick the same box on the AutoFormat tab as well. Existing curly quotes in the document stay curly until you replace them.
How do I turn off smart quotes in Google Docs?
Go to Tools, Preferences, and untick Use smart quotes. The setting applies to that account in every document. As in Word, quotes already in the document are not changed.
How do I replace smart quotes with straight ones in Word?
Turn off the AutoCorrect setting first, otherwise Word will re-curl them. Then open Find and Replace, put " in both boxes and click Replace All; with the setting off, Word replaces every curly double quote with a straight one. Repeat with ' for the single quotes and apostrophes.
Does an apostrophe count as a smart quote?
The typographic apostrophe is the same character as the closing single smart quote, U+2019. In prose it is correct. In code and data it breaks the same things a curly quote does: don’t inside a SQL string is fine, but ‘don’t’ as the delimiter is not.
Last updated 2026-09-16. Everything on this page runs in your browser. Nothing you type or upload leaves your device.