Blog / Compare
Straight vs curly quotes
When to use which
| Character | When to use it | Watch out for |
|---|---|---|
| " Quotation Mark | Anywhere a machine reads the text: JSON, JavaScript and shell string literals, CSV fields, config files, and code samples quoted inside prose. | The same glyph at both ends, so it can never show where a quotation turns around. Curled by accident in a code block it is a syntax error, not a blemish. |
| ' Apostrophe Apostrophe-quote | SQL literals, most programming languages, and any value you will later have to match exactly — a name field above all. | Escaped by doubling, which is why exports read 'O''Brien'. It is the mark that breaks web forms on surnames rather than on prose. |
| “ Left Double Quotation Mark Double Turned Comma Quotation Mark | Opening a quotation in English prose that a person will read. | German closes with this mark rather than opening with it, so no single autocorrect rule serves a bilingual document. |
| ” Right Double Quotation Mark Double Comma Quotation Mark | Closing that quotation. | Not the inches mark. Six inches is written with a double prime, two slanted strokes, and no spellchecker will ever query the substitution. |
| ‘ Left Single Quotation Mark Single Turned Comma Quotation Mark | Opening a quotation nested inside another in American style, or the outer pair in many British house styles. | Never an apostrophe. This is the character autocorrect wrongly supplies at the start of a word, pointing the wrong way. |
| ’ Right Single Quotation Mark Single Comma Quotation Mark | Closing a single quotation, and every apostrophe in prose: it's, we've, the '90s. | One character doing two jobs, which is why a curled apostrophe and a typed one are different strings to your database even though they read identically. |
Four of these six characters are not on your keyboard, and that one fact drives almost everything that goes wrong with them. The decision underneath is not a matter of taste. It is whether the text you are typing will be read by a person or parsed by a machine — and the application you are typing into has usually made that call for you before the thought occurred to you.
The straight double quote and the straight apostrophe are typewriter economies that ASCII made permanent. One key had to open and close, so a single vertical, neutral mark took both jobs, and the apostrophe key absorbed the single quote alongside it. The marks typography actually wants are the other four: an opening and a closing double, an opening and a closing single, drawn as turned and upright commas so a reader can see at a glance where a quotation starts and stops. Unicode is not neutral about it either: its notes on the straight pair state outright that the curly characters are the preferred ones for English, and that the apostrophe is properly the closing single quote.
What decides which you get, most of the time, is a checkbox. Word, Google Docs and Pages replace straight marks as you type — the setting is called smart quotes in all three, and it is on by default. macOS applies the same substitution system-wide from Keyboard settings, so it reaches Mail, Notes and any text field that has not opted out. Code editors and terminals do not substitute at all. The consequence is that the character you end up with depends on which window had focus when you typed, which is how the same sentence written twice becomes two different strings without anyone making a mistake.
That is a nuisance in prose and a hard failure in code. JSON has exactly one string delimiter and it is the straight double quote; draft a config value in a document, paste it into a file, and the parser stops on an unexpected token. JavaScript and Python behave the same way, and recent Pythons are kind enough to name the offending codepoint in the error message. Shell quoting is worse, because a curly quote is not an error there — it is an ordinary character in a filename, so the command runs and does the wrong thing quietly. The backtick belongs to the same trap: it is neither quote nor apostrophe, but Markdown and shell command substitution both claim it, so text carrying one rarely survives a round trip through either.
Data has its own version. Under RFC 4180 a CSV field containing a comma or a line break is wrapped in straight double quotes, and a literal one inside such a field is escaped by doubling it. Curl those wrappers and the file is no longer a CSV — it is a single column with the commas still in it. The apostrophe does the same work in SQL and fails in the same way, which is why a surname like O'Brien has broken more forms than any other punctuation on the keyboard, and why exported data is full of 'O''Brien'.
The quietest failure is matching, and it is the one that costs money. A customer types don't into a search box with a straight apostrophe; your CMS stored don't with a curly one; the two are different strings, and an exact match finds nothing. Search engines fold them for you. Your own database does not, and neither does a LIKE clause, a spreadsheet lookup or a deduplication script. If a lookup fails on one name in ten thousand and works on all the rest, this is the first thing to test — and the fix is to normalise at write time rather than to hunt for the mismatch later. Two neighbours are worth knowing for the same reason: the closing single quote is not a prime, which marks feet and minutes and slants where the quote curls, and the closing double quote is not the double prime that means inches.
So the rule is a division of labour rather than a preference. Curl the quotes in anything a person will read, keep them straight in code, in data, and in anything you will later search or compare — and be deliberate about it, because the default setting is not. On a Mac, Option-[ and Option-Shift-[ are the opening and closing doubles, and the same pairing on the right bracket key gives the singles; on Windows the Alt codes are 0147 and 0148 for the doubles, 0145 and 0146 for the singles. In HTML they are “, ”, ‘ and ’. Most usefully of all, every one of those applications lets you turn the substitution off for the document where it is doing harm, which is a better habit than fixing the same paste twice a week.