Straight and curly apostrophes: characters, codes and keyboard input

Straight vs curly apostrophe: the Unicode characters involved, HTML codes, keyboard input on Windows, Mac and Linux, and when to keep plain ASCII.

An apostrophe can be stored as several different characters. Most look nearly identical on screen, but they behave differently in code, search fields, data files and older software. This guide covers what each character is, how to type it, and whether converting straight apostrophes to curly ones (or back) suits a given use.

Short recommendation

For published prose such as articles, books, marketing copy and formatted documents, the curly apostrophe (U+2019) is the typographic convention. Unicode itself names U+2019 as the preferred character for the apostrophe in ordinary text. For anything a machine has to parse, keep the straight apostrophe (U+0027). That includes source code, command lines, configuration files, CSV and JSON data, and fields that only accept ASCII. The main benefit of curly apostrophes is polish and consistency with professional typesetting. The main tradeoff is that they are a different character, so text that looks the same may no longer match, compile or validate. If you can't control where the text will end up, plain straight apostrophes are the safer choice.

Types of apostrophe characters

Only the first two characters below are normal apostrophe choices in English. The others appear for specialized reasons or by mistake. Mistaken ones are often produced by autocorrect or by someone hunting for an "angled" mark on the keyboard.

Character | Unicode name | Code point | HTML entity / numeric reference | Typical use
' | APOSTROPHE | U+0027 | ' or ' | Straight or typewriter apostrophe; the only apostrophe in ASCII (decimal 39, hex 27); also the single-quote delimiter in most programming languages
’ | RIGHT SINGLE QUOTATION MARK | U+2019 | ’ or ’ | Curly or typographic apostrophe; also a closing single quote
‘ | LEFT SINGLE QUOTATION MARK | U+2018 | ‘ or ‘ | Opening single quote; often wrongly inserted as an apostrophe at the start of a word
ʼ | MODIFIER LETTER APOSTROPHE | U+02BC | ʼ | An apostrophe that functions as a letter, such as a glottal stop in some orthographies; not the standard choice for English contractions
′ | PRIME | U+2032 | ′ or ′ | Feet, arcminutes and mathematical notation; not an apostrophe
` | GRAVE ACCENT | U+0060 | ` | Backtick used in code and markup; sometimes misused as an angled apostrophe
´ | ACUTE ACCENT | U+00B4 | ´ or ´ | Spacing accent mark; sometimes misused as an angled apostrophe

What people mean by an "angled apostrophe"

The phrase is ambiguous. Sometimes it describes how a particular font draws the straight apostrophe U+0027, since some typefaces give it a slight slant or taper. In that case the character is still U+0027, and only its visual design differs. Other times it refers to the grave accent or acute accent typed in place of an apostrophe. Those are different characters with different meanings. They can break spell-checking, word matching and search, so they should be replaced with U+0027 or U+2019.

What converting apostrophes actually changes

Switching between straight and curly apostrophes is a character substitution, not a visual effect. "Smart quotes" features in word processors, publishing tools and conversion utilities replace the stored U+0027 with U+2019 (or U+2018). Anything that later reads the text, whether a search index, compiler, database or screen reader, receives the new character. Changing the font, by contrast, changes only how a character is drawn. The underlying code point stays the same. CSS cannot turn a straight apostrophe into a curly one either. The CSS quotes property controls only the quotation marks generated for quote elements and open-quote or close-quote content, and leaves apostrophes typed in the text untouched.

Where automatic conversion goes wrong

Converting straight to curly requires guessing whether each mark opens a quotation, closes one or sits inside a word. Most tools decide from the neighboring characters. That fails predictably when an apostrophe starts a word, because the tool sees a mark after a space and assumes an opening quote.

  • '90s becomes ‘90s (wrong) instead of ’90s (correct)
  • 'tis becomes ‘tis instead of ’tis
  • rock 'n' roll becomes rock ‘n’ roll instead of rock ’n’ roll
  • Feet and inch marks such as 5'10" become curly quotes when primes (or straight marks) were intended

Converting curly to straight is simpler and does not change the meaning of an apostrophe. It does discard the distinction between an opening single quote, a closing single quote and an apostrophe. That distinction is impossible to recover automatically later. Review the result by eye after converting in either direction, especially around leading apostrophes and measurements.

Typing apostrophes on a keyboard

The apostrophe key on a standard US keyboard types the straight U+0027. Software may then change it, depending on autocorrect or smart-quote settings. To enter the curly character directly, use the methods below. They apply to common default configurations. Keyboard layouts, input methods and applications vary, so they may not work identically everywhere.

Environment | Curly apostrophe ’ (U+2019) | Left single quote ‘ (U+2018) | Straight ' (U+0027)
Windows (numeric keypad, Num Lock on) | Alt+0146 | Alt+0145 | Apostrophe key, or Alt+39
Microsoft Word on Windows | Type 2019 then press Alt+X; or Ctrl+' then ' | Type 2018 then press Alt+X; or Ctrl+then | Apostrophe key with smart quotes off, or press Ctrl+Z right after Word converts it
macOS (US layout) | Option+Shift+] | Option+] | Apostrophe key with smart quotes off in the app or system settings
Linux (GTK/IBus apps) | Ctrl+Shift+U, then 2019, then Space or Enter | Ctrl+Shift+U, then 2018, then Space or Enter | Apostrophe key
HTML | ’ or ’ | ‘ or ‘ | ' or ' (often typed directly)

Many phone and tablet keyboards offer alternative apostrophe characters when you long-press the apostrophe key. Some also convert straight apostrophes automatically through a smart-punctuation setting. Whether this happens, and which characters appear, depends on the keyboard app and system version, so it is worth checking the settings on the device in use.

Will the text still work after copying or sharing?

Code, commands and data

This is where curly apostrophes cause the most practical trouble. Programming languages, shells, SQL and most configuration formats recognize only U+0027 as a single-quote delimiter. A snippet that passes through a word processor or a smart-quoting chat or email client can come out looking correct while failing to run.

print('It works')     # straight U+0027 delimiters: valid Python
print(‘It fails’)     # curly U+2018/U+2019: Python rejects these as invalid characters

Write and share code in plain-text editors or code blocks, which do not apply smart quotes. If a curly apostrophe needs to appear inside a string, an escape such as \u2019 in JavaScript, JSON or Python, or \2019 in CSS content, keeps the source file ASCII-safe.

Search, matching and editing

Because U+0027 and U+2019 are different characters, an exact-match comparison treats don't and don’t as different strings. Some search engines, find features and databases normalize the two, and others do not. No tests of specific products were available for this article, so check the actual destination rather than assuming. Unicode's default word-boundary rules are designed to keep contractions together with either character, so word selection and word counts usually behave the same. Inconsistent mixing is the real hazard: a document containing both forms can defeat find-and-replace, deduplication and spell-check dictionaries.

Encoding and older systems

The straight apostrophe is plain ASCII and survives virtually any encoding. The curly apostrophe is not in ASCII. In UTF-8 it is stored as three bytes (E2 80 99), and in Windows-1252 as the single byte 0x92. When UTF-8 text is wrongly decoded as Windows-1252, a curly apostrophe shows up as the garbled sequence ’. If text is going into a system with uncertain encoding support, such as legacy databases, some SMS gateways, fixed-format exports or ASCII-only form fields, straight apostrophes avoid that risk.

Accessibility

Both U+0027 and U+2019 are standard punctuation, and neither changes the reading order of the text. How a particular screen reader announces them can depend on its punctuation verbosity settings. No documentation or scoped tests for specific assistive technologies were available here, so that remains unverified. The characters to avoid for accessibility reasons are the misused ones, namely the grave accent, the acute accent and the prime. Assistive technology may announce them by name, and they can break pronunciation of the word they sit in.

When plain straight apostrophes are preferable

  • Source code, shell commands, regular expressions and SQL
  • JSON, CSV, YAML, configuration files and other machine-read data
  • Identifiers, usernames, file names and fields that may be matched exactly
  • Destinations with unknown or limited encoding support
  • Text that other people will edit in plain-text tools, where mixed forms are likely to creep in

Checklist before converting

  • Decide on one form per document or dataset and apply it consistently
  • Use U+2019 for curly apostrophes, never U+2018, and check every apostrophe at the start of a word
  • Replace grave accents, acute accents and primes that were used as apostrophes
  • Leave code, commands and data fields in straight U+0027
  • After copying into the destination, confirm that search, validation and display behave as expected there