Smart Quotes vs Straight Quotes: How to Convert or Turn Them Off
Smart quotes are the curved quotation marks that word processors insert for you: “like these” instead of "like these". They look better in prose and they break code. This guide lists the characters and their code points, shows where each kind belongs, and explains how to switch smart quotes off and how to convert between the two.
Smart, curly and straight: the terms
Curly quotes, also called typographic quotes, are separate opening and closing marks that curve towards the text they enclose. Straight quotes are the vertical marks on your keyboard, one for double and one for single, with no difference between opening and closing. They are an inheritance from the typewriter, which saved keys by using one mark for both directions.
Smart quotes is the name of the software feature that replaces a straight quote with the curly one it guesses you meant, as you type. People also use the term for the curly marks themselves, so smart quotes and curly quotes mean the same characters in practice.
The characters and their codes
| Mark | Name | Unicode | HTML |
|---|---|---|---|
" | Straight double quote | U+0022 | " |
' | Straight single quote, apostrophe | U+0027 | ' |
“ | Left double quotation mark | U+201C | “ |
” | Right double quotation mark | U+201D | ” |
‘ | Left single quotation mark | U+2018 | ‘ |
’ | Right single quotation mark, typographic apostrophe | U+2019 | ’ |
„ | Low double quotation mark, used to open quotes in German and other languages | U+201E | „ |
′ ″ | Prime and double prime, for feet and inches or minutes and seconds | U+2032, U+2033 | ′, ″ |
How to type curly quotes
| Mark | Mac (US layout) | Windows (numeric keypad) |
|---|---|---|
“ | Option + [ | Alt + 0147 |
” | Option + Shift + [ | Alt + 0148 |
‘ | Option + ] | Alt + 0145 |
’ | Option + Shift + ] | Alt + 0146 |
The Mac shortcuts are for the US keyboard layout; on other layouts the bracket keys sit elsewhere and the combinations differ. On a phone, touch and hold the quote key to see the curly versions.
Where each kind belongs
Use curly quotes in text meant for readers: books, articles, reports, slides, web copy and anything that will be printed. They show at a glance where a quotation starts and ends, and the curly apostrophe matches the shape of the letters around it.
Use straight quotes in text meant for machines: source code, JSON, CSV and other data files, configuration files, command lines, spreadsheet formulas, HTML attributes and web addresses. In all of these the quote mark is part of the syntax, and only the straight character counts.
Measurements are a third case. Five feet ten inches is properly written with prime marks, and straight quotes are the accepted keyboard substitute. Curly quotes are wrong there, and it is a common side effect of the smart quotes feature.
Why curly quotes break code, CSV and JSON
To a program, a curly quote is simply a different character from a straight one. Where the language expects U+0022 or U+0027, nothing else will do.
| Where | Pasted text | What happens |
|---|---|---|
| JSON | {“name”: “Ada”} | The parser rejects the file. JSON strings must be wrapped in straight double quotes. |
| Python | print(“hello”) | A syntax error that reports an invalid character, U+201C. |
| Command line | grep “two words” notes.txt | The shell does not treat the marks as quotes, so the phrase is split into two arguments. |
| CSV | “Smith, John”,42 | The comma inside the name is no longer protected, and the row is read as three fields. |
| SQL | WHERE name = ‘Ada’ | The database reports a syntax error. |
| Spreadsheet formula | =IF(A1=“yes”,1,0) | The formula is refused or returns an error. |
These errors are hard to spot because, in many fonts, the two kinds of quote look almost the same at small sizes. They usually arrive when a snippet has travelled through a word processor, an email, a chat app or a slide deck before reaching your editor.
How to turn smart quotes off
- Word on Windows: File > Options > Proofing > AutoCorrect Options. On the AutoFormat As You Type tab, untick the box that replaces straight quotes with smart quotes.
- Word on Mac: Word > Preferences > AutoCorrect > AutoFormat As You Type, then untick the same box.
- Google Docs: Tools > Preferences, then untick Use smart quotes.
- macOS, all apps: System Settings > Keyboard > Text Input > Edit, then switch off Use smart quotes and dashes. Older versions of macOS have the same switch in the Keyboard pane of System Preferences. Many Mac apps also have their own toggle under Edit > Substitutions > Smart Quotes.
- iPhone and iPad: Settings > General > Keyboard, then switch off Smart Punctuation.
If you only want a straight quote once, you do not need to change a setting. In Word, press Ctrl + Z immediately after the quote curls, and it goes back to straight.
How to convert curly quotes to straight quotes
With the AI Text Cleaner
Paste the text into the AI Text Cleaner. The option Straighten curly quotes is on by default. It turns the left, right and low double quotation marks and the double prime into a straight double quote, and the single versions and the prime into a straight single quote. The summary line tells you how many it changed. It leaves angle quotes (the guillemets used in French and other languages) and backticks alone.
In Microsoft Word
First turn the smart quotes option off as described above. Then open Find and Replace, type a straight double quote in both the Find and the Replace boxes, and choose Replace All. Word's search treats curly and straight quotes as the same, so every double quote is retyped as a straight one. Repeat with the single quote. The trick works in reverse as well: with the option switched on, the same replacement makes every quote curly.
In a code editor
Switch on regular expressions in find and replace, search for [“”] and replace it with ". Then search for [‘’] and replace it with '.
In Python
table = str.maketrans({"“": '"', "”": '"', "‘": "'", "’": "'"})
clean = text.translate(table)
Where smart quotes guess wrong
The feature decides between an opening and a closing mark by looking at the neighbouring characters, and a few cases fool it. An apostrophe at the start of a word, as in the shortened form of a decade or in rock ’n’ roll, is often turned into an opening single quote, which faces the wrong way. Quotes typed directly after a dash or a bracket can also come out backwards. In careful typesetting these are fixed by hand.
Quick answers
Are smart quotes and curly quotes the same thing? Yes, in everyday use. Strictly, smart quotes is the feature that inserts them and curly quotes are the characters.
Should I use curly or straight quotes in an essay? Curly, unless your style guide says otherwise. The important thing is to use one kind throughout.
Why do my quotes show up as strange symbols such as an accented a and a euro sign? The file was written in one encoding and read in another. See our guide to mojibake.