Curly quotes vs straight quotes: typography and coding rules
Comparing curly quotes vs straight quotes highlights the divide between digital typography and computer programming. Typographic curly quotes (“ ” ‘ ’) provide polished readability in prose, while straight quotes (" ') are strict syntax requirements in code.
The origin of straight quotes: a typewriter compromise
To understand the difference between curly quotes vs straight quotes, we have to look back at the mechanical typewriter invented in the nineteenth century. Early mechanical typewriters had limited keyboard space. To save manufacturing costs and physical levers, typewriter makers eliminated separate opening quotation marks (“), closing quotation marks (”), and single apostrophes (’), replacing all four characters with a single vertical generic mark: the straight quote (" and ').
When computing emerged in the 1960s, early standards like ASCII adopted the typewriter’s straight quotes as characters 34 (") and 39 ('). While practical for programming syntax, straight quotes are considered typographical errors in professional publishing and graphic design.
1. When to use curly quotes: books, articles, and websites
In written prose, always use curly quotes (also known as smart quotes, typographer’s quotes, or book quotes):
- Opening and closing double quotes: Use “left double quote” (
“, U+201C) at the beginning of dialogue, and “right double quote” (”, U+201D) at the end: “Reading books expands the mind,” she said. - Opening and closing single quotes: Use ‘left single quote’ (
‘, U+2018) for quotes within quotes, and ‘right single quote’ (’, U+2019) at the conclusion: “He said, ‘Watch out!’ before ducking.” - The apostrophe: The correct typographical apostrophe is always the curly right single quotation mark (
’, U+2019): don’t, it’s, the 1990s’ culture. Never use a straight quote or an accent mark as an apostrophe.
Curved marks embrace the enclosed words naturally, guiding the reader’s eye smoothly across sentences. Explore all punctuation marks in our quotation marks collection.
2. When straight quotes are mandatory: coding and terminals
While curly quotes look beautiful in literature, they are disastrous in programming. Modern compilers and interpreters treat curly quotes as unexpected Unicode characters rather than string delimiters:
In JavaScript, Python, C++, HTML, SQL, and terminal command lines, you must strictly use straight ASCII quotes: const name = "SymbolHub";. If you paste text from Microsoft Word or Apple Notes into a code editor, auto-formatted curly quotes will cause immediate syntax crashes like SyntaxError: Invalid or unexpected token.
Straight quotes are also used in mathematics and cartography to represent feet (' prime) and inches (" double prime), although dedicated Unicode prime characters (′ U+2032 and ″ U+2033) provide even better typographic precision.
3. How word processors handle "Smart Quotes"
Modern software like Microsoft Word, Apple Pages, and Google Docs automatically converts typed straight quotes into curly quotes using a feature called Smart Quotes. As you type, the software inspects the surrounding context: if the quote follows a space, it inserts an opening quote (“); if it follows a letter, it inserts a closing quote (”).
However, automated smart quotes make frequent mistakes with contractions that begin with an elided letter or number:
- Decades: Typing
'90soften mistakenly produces an opening quote (‘90s) because it follows a space. The correct typographic character is a closing apostrophe:’90s. - Slang and dialect: Words like
’cause,’em, androck ’n’ rollrequire curly apostrophes (’), not opening quotes (‘).
4. How to type curly quotes manually on keyboard
If your auto-correct inserts the wrong direction, you can type exact curly quotes using these shortcuts:
| Character | Official Name | Mac Shortcut | Windows Alt Code |
|---|---|---|---|
‘ | Left Single Quote | Option + ] | Alt + 0145 |
’ | Right Single Quote / Apostrophe | Option + Shift + ] | Alt + 0146 |
“ | Left Double Quote | Option + [ | Alt + 0147 |
” | Right Double Quote | Option + Shift + [ | Alt + 0148 |
5. How developers disable smart quotes
If you write technical articles or code snippets in note-taking apps, disable automatic smart quote substitution to prevent syntax pollution:
- On macOS: Go to System Settings > Keyboard > Text Input > Edit... and toggle off “Use smart quotes and dashes”.
- In Microsoft Word: Go to File > Options > Proofing > AutoCorrect Options > AutoFormat As You Type, and uncheck “Straight quotes with smart quotes”.
- In Google Docs: Go to Tools > Preferences > General, and uncheck “Use smart quotes”.
Learn how other typographic marks interact with grammar in our guide on em dash vs en dash vs hyphen.
Frequently asked questions
What are curly quotes called?
They are formally known as typographic quotes, smart quotes, or book quotes. Single curly quotes are called left/right single quotation marks.
Why do curly quotes break code?
Programming languages only recognize plain ASCII straight quotes (U+0022 and U+0027) as string delimiters. Curly quotes are foreign Unicode characters that trigger syntax errors.
How do I type a curly apostrophe on a Mac?
Press Option + Shift + ] (right bracket) to insert the proper typographical apostrophe (’).
What is the correct apostrophe for the 90s?
The correct form is ’90s (with a right apostrophe facing left), not ‘90s. Word processors often mistakenly insert an opening quote after spaces.