Smart Quotes vs Straight Quotes: Which Should You Use?

Use smart quotes, the curly kind, in text that people will read as prose: articles, books, letters, slides. Use straight quotes in anything a program will read: source code, JSON, CSV, shell commands, HTML attributes, configuration files and formulas. Neither style is the correct one in general. They are different characters with different jobs, and trouble starts when one lands where the other was expected, usually because a word processor swapped them as you typed.

The characters involved

Character Name Code point Where it belongs
" Quotation mark (straight double quote) U+0022 Code, data formats, plain typing
' Apostrophe (straight single quote) U+0027 Code, data formats, plain typing
“ Left double quotation mark U+201C Opening quote in prose
” Right double quotation mark U+201D Closing quote in prose
‘ Left single quotation mark U+2018 Opening single quote in prose
’ Right single quotation mark U+2019 Closing single quote, and the apostrophe in prose
′ Prime U+2032 Feet, minutes
″ Double prime U+2033 Inches, seconds

The straight marks are neutral: one character serves as both the opening and the closing quote. The curly marks come in pairs, so the same job takes four characters. Note the entry for U+2019. Unicode names it as the preferred character for the apostrophe, so in typeset prose the apostrophe in don’t and a closing single quote are the same character.

Where each one is right

Curly quotes: prose for human readers

Published writing uses paired quotation marks because they show at a glance where a quotation opens and closes, and because that is what readers of typeset text expect. If the destination is a printed page, an article, a newsletter or a presentation, curly is the convention and there is no technical reason to change it.

Straight quotes: anything a parser reads

Programming languages and data formats define their syntax in terms of U+0022 and U+0027. A curly quote is not a variant spelling of those. It is an unrelated character.

  • JSON. A string begins and ends with U+0022. {“id”: 7} is not valid JSON.
  • CSV. The character that wraps a field containing commas or line breaks is the straight double quote. Wrapped in curly quotes, “Lyon, France” is split into two fields at the comma.
  • Source code and shell commands. print(“hello”) stops with an invalid-character error in Python, and a shell treats curly quotes as ordinary characters, so a quoted phrase is split into separate arguments at each space.
  • HTML attributes. In <a href=“/pricing/”> the parser reads an unquoted value, and the curly marks become part of the address.
  • Configuration files, SQL and spreadsheet formulas. The same reasoning applies wherever quotes delimit a value.

Measurements are a third case

5'10" typed with straight marks is the plain-text way to write feet and inches. The typographically correct characters are primes, 5′10″, which are neither straight nor curly quotes. What autocorrect produces, 5’10”, is wrong in both worlds.

Text that will be rendered later

Some publishing systems convert straight quotes to curly ones when they render a page. If your text is going into one of those, straight quotes in the source are the safer choice: prose comes out typeset and code samples stay intact.

How smart quotes get into text

Almost nobody types a curly quote on purpose. Software substitutes it:

  • Word can replace straight quotes with smart quotes as you type. The setting is the "Straight quotes" with "smart quotes" check box on the AutoFormat As You Type tab of its AutoCorrect options.
  • macOS has a “Use smart quotes and dashes” switch in its keyboard settings, and iPhone has Smart Punctuation.
  • Other editors and word processors have similar settings.

The same features deal in dashes. Word’s replaces a double hyphen with an em dash, and a hyphen that has a space on each side with an en dash; the Apple settings turn double hyphens into em dashes. If you regularly write code or data in one of these applications, switching the setting off at the source is simpler than converting afterwards.

The replacement is stored in the document as a different character, not as formatting. That is why curly quotes survive “paste without formatting”: a plain-text paste drops fonts and colours and keeps every character. The guide to plain text versus rich text explains the distinction.

The classic failures

Code copied from a document will not run. A command that has passed through a word processor, a slide or an email comes out like this:

curl -H “Accept: application/json” https://example.com/api

The shell does not see a quoted header. It sees a word that starts with a curly quote, then a second word, and the command fails with an error that never mentions quotes. Dashes fail the same way: --verbose can become —verbose, which is not an option any program recognises.

The apostrophe that points the wrong way. Autocorrect chooses the direction of a quote from what comes before it. After a space it assumes an opening quote, which is wrong when a word begins with an apostrophe:

Wrong:  ‘90s     rock ‘n’ roll     ‘tis
Right:  ’90s     rock ’n’ roll     ’tis

The correct character in each case is U+2019. No mechanical rule can reliably tell a leading apostrophe from an opening single quote, so this one has to be fixed by hand.

Mixed styles in one document. Paste straight-quoted text into a document where you have been typing with smart quotes on, and both styles sit side by side. It looks inconsistent, and a search for don't can miss don’t in any tool that compares characters exactly.

Encoding damage. Curly quotes are outside ASCII, so a file opened with the wrong encoding shows sequences such as “ and ’ where the quotes were. Straight quotes cannot be damaged this way.

Dashes and the ellipsis

Three more characters tend to arrive alongside curly quotes and raise the same question.

Character Name Code point Plain-text equivalent
– En dash U+2013 -
— Em dash U+2014 -
… Horizontal ellipsis U+2026 ...

In prose they are correct and useful: the en dash for ranges such as 10–15, the em dash for a break in a sentence, the ellipsis for an omission. In data they cause quiet errors. A command-line flag written with an em dash is not recognised, a number or range written with an en dash lacks the plain hyphen that formulas and parsers look for, and an ellipsis is one character where a length limit or a pattern expects three.

Converting with the Text Cleaner

The Text Cleaner has a Typography group under Advanced Cleaning Options with five separate switches:

  • Smart quotes → straight quotes converts curly double quotes (“, ” and the low „) to ".
  • Smart apostrophes → straight apostrophes converts curly single quotes and apostrophes (‘, ’) to '.
  • En dash → hyphen replaces – with -.
  • Em dash → hyphen replaces — with -.
  • Ellipsis character → three periods replaces … with ....

Tick the ones the destination needs and press Clean Text. With all five ticked:

Before

“It’s ready — almost,” she said. Pages 10–15 cover the rest…

After

"It's ready - almost," she said. Pages 10-15 cover the rest...

The summary for this example reports 2 smart quotes straightened, 1 smart apostrophe straightened, 1 en dash replaced, 1 em dash replaced and 1 ellipsis character expanded.

All five switches are off by default in every preset, including Word / Docs. That is deliberate. Converting typography is a decision about where the text is going, not a cleanup that is always right, and a writer who wants curly quotes should never lose them as a side effect of removing extra spaces. Things to weigh before ticking:

  • The conversion is mechanical. It cannot tell a quote that delimits a string from one that belongs inside it. If a JSON value contains a quotation, straightening every quote leaves unescaped quotes inside the string, and those need escaping by hand.
  • A hyphen is not a dash. Each dash is swapped for a single hyphen and nothing around it changes, so rain—or shine becomes rain-or shine. Read sentences that used dashes after converting.
  • It only goes one way. Turning straight quotes back into curly ones means deciding which are opening and which are closing, with the apostrophe problem described above. The Text Cleaner does not attempt it.
  • Other punctuation is left alone. Guillemets such as « and » and the prime marks are different characters and are not converted.

For code, the two quote options are usually enough. Leave the dash options off unless the dashes are part of the syntax: an en dash inside a string value is simply data.

If the text came from a word processor, quotes are rarely the only thing that travelled with it; see cleaning text copied from Word and Google Docs. Text copied from a chat assistant can arrive with typographic quotes and dashes too, alongside Markdown markers, which the guide to cleaning AI text formatting deals with.

Sources

  1. General Punctuation, Range: 2000–206F (Unicode code chart) — Unicode Consortium
  2. RFC 8259: The JavaScript Object Notation (JSON) Data Interchange Format — IETF / RFC Editor
  3. RFC 4180: Common Format and MIME Type for Comma-Separated Values (CSV) Files — IETF / RFC Editor
  4. HTML Standard: The HTML syntax — WHATWG
  5. AutoFormat as you Type — Microsoft Support

This guide was drafted with AI assistance and reviewed by the publisher. See the editorial policy for how guides are written and corrected.