Unicode and UTF-8 codes for apostrophes and smart quotes

Code points, UTF-8 bytes, HTML entities and escapes for straight and curly apostrophes and smart quotes, and when converting to curly marks causes problems.

Converting a straight apostrophe to a curly one looks like a cosmetic change, but it swaps one character for another. This guide lists the codes for each apostrophe and quotation mark, explains what the substitution changes, and covers when the curly version helps and when plain ASCII is the safer choice.

Quick reference: apostrophe and quotation mark codes

Character | Unicode name | Code point | UTF-8 bytes (hex) | HTML named entity | HTML decimal
' | APOSTROPHE | U+0027 | 27 | ' | '
’ | RIGHT SINGLE QUOTATION MARK | U+2019 | E2 80 99 | ’ | ’
‘ | LEFT SINGLE QUOTATION MARK | U+2018 | E2 80 98 | ‘ | ‘
" | QUOTATION MARK | U+0022 | 22 | " | "
“ | LEFT DOUBLE QUOTATION MARK | U+201C | E2 80 9C | “ | “
” | RIGHT DOUBLE QUOTATION MARK | U+201D | E2 80 9D | ” | ”
ʼ | MODIFIER LETTER APOSTROPHE | U+02BC | CA BC | none | ʼ
‚ | SINGLE LOW-9 QUOTATION MARK | U+201A | E2 80 9A | ‚ | ‚
„ | DOUBLE LOW-9 QUOTATION MARK | U+201E | E2 80 9E | „ | „
« | LEFT-POINTING DOUBLE ANGLE QUOTATION MARK | U+00AB | C2 AB | « | «
» | RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK | U+00BB | C2 BB | » | »

Which character is the Unicode apostrophe?

There are two main candidates. U+0027 is the ASCII apostrophe, often called the straight or typewriter apostrophe. It does double duty as a single quotation mark and a programming delimiter. U+2019, the right single quotation mark, is the curly or slanted apostrophe used in typeset text. The Unicode Standard names U+2019 as the preferred character for the apostrophe when it works as punctuation, as in contractions and possessives.

Unicode has no separate code point for a curly apostrophe. The apostrophe in don’t and the closing mark in ‘yes’ are the same character, U+2019. Software therefore cannot tell an apostrophe from a closing single quote by code point alone.

U+02BC, the modifier letter apostrophe, is intended for languages where the apostrophe is a letter, such as a glottal stop, rather than punctuation. Text-processing software treats it as part of a word, which matters for word selection and line breaking. In English prose it is the wrong choice. It will not match words typed with U+0027 or U+2019, and some fonts do not include it.

French has no apostrophe of its own. Typeset French generally uses U+2019 (l’été), and plain-text French uses U+0027. French quotation marks are a separate matter. They are guillemets, U+00AB and U+00BB, usually separated from the quoted text by a no-break space (U+00A0) or a narrow no-break space (U+202F).

Some characters look like apostrophes but are not: the prime ′ (U+2032), the acute accent ´ (U+00B4), the grave accent ` (U+0060), the reversed-9 mark ‛ (U+201B) and the fullwidth apostrophe ' (U+FF07). None of them work as substitutes. They break search matching, and screen readers that announce punctuation may name them as different symbols.

Smart quotes in ASCII and UTF-8

ASCII has no smart quotes. Its only quote-like characters are the double quote (0x22), the apostrophe (0x27) and the grave accent (0x60). Curly quotes sit outside ASCII. In UTF-8 each one takes three bytes, all starting with E2 80, so a curly apostrophe uses three times the storage of a straight one.

The legacy Windows-1252 encoding put curly quotes at single bytes 0x91 to 0x94 (‘ ’ “ ”). This explains the Windows Alt codes and a common display fault. When UTF-8 bytes E2 80 99 are wrongly decoded as Windows-1252, the curly apostrophe appears as ’. When a Windows-1252 byte 0x92 is read as UTF-8, it is invalid and usually shows as the replacement character �. The reliable fix is to correct the declared encoding, not to find and replace the garbled sequences.

Escape sequences and typing methods

HTML named        ’   ‘   “   ”   '
HTML hex          ’  ‘  “  ”  '
JavaScript, JSON  "\u2019"
Python            "\u2019"  or  "\N{RIGHT SINGLE QUOTATION MARK}"
Java, C#          "\u2019"
CSS content       "\2019"
URL (percent)     %E2%80%99

The ' entity is valid in XML and HTML5 but was not defined in HTML 4, so ' is the more portable way to escape a straight apostrophe in markup. Inside an HTML attribute delimited by single quotes, U+0027 must be escaped, but U+2019 does not need to be.

On Windows, holding Alt and typing 0146 on the numeric keypad produces ’. The codes 0145, 0147 and 0148 produce ‘, “ and ”. On a Mac with a US layout, Option+Shift+] types ’, Option+] types ‘, Option+[ types “ and Option+Shift+[ types ”. Other keyboard layouts may assign these characters to different keys.

What converting straight quotes to curly ones changes

Smart-quote conversion replaces characters. The stored code points and bytes change, so the converted text is a different string from the original. Two other techniques only look similar:

  • Fonts: some typefaces draw U+0027 with a slant. The character is still U+0027, and copying it pastes a straight apostrophe.
  • CSS: the quotes property, used with the q element or ::before and ::after content, displays curly marks without adding them to the source text. Because these marks are generated rather than stored, whether they appear in copied text depends on the browser.

Nothing in this process is reversed or mirrored. When people ask for a "reversed" or "backwards" apostrophe, they usually mean the left single quotation mark ‘ (U+2018) or the reversed-9 mark ‛ (U+201B). These are distinct characters, not flipped versions of an apostrophe.

Automatic converters guess whether a mark opens or closes based on the surrounding characters. They often misplace an apostrophe at the start of a word. The correct forms are ’90s, ’til and rock ’n’ roll, all using U+2019. A converter that sees a space before the mark often inserts U+2018 instead, producing ‘90s. Check leading elisions by hand after any automatic pass.

Will curly quotes survive copying and sharing?

  • Code and commands: JSON, shells, Python, SQL and most other languages accept only straight quotes as string delimiters. A snippet copied from a word processor with smart quotes will fail or behave unexpectedly.
  • Search and matching: don’t (U+2019) and don't (U+0027) are different strings. Some search engines normalize them, but exact-match tools such as grep, database queries, spreadsheet lookups and form validation often do not unless they are configured to.
  • Text messages: the GSM 7-bit default alphabet has no curly quotes. One curly apostrophe can switch a message to UCS-2 encoding, which cuts the per-segment limit from 160 characters to 70. Some phones and gateways substitute straight quotes automatically, but this varies.
  • Legacy systems and email: a mismatched charset declaration produces the garbled sequences described above.
  • URLs, file names and usernames: curly marks are percent-encoded in URLs and are hard to type, so straight characters or no quotes are safer.
  • Assistive technology: screen-reader output depends on the product and its punctuation verbosity settings. Test with the screen readers your audience uses.

Is the conversion right for your use?

For published prose, such as articles, books, interface copy and typeset documents, curly marks (U+2019 for apostrophes, U+2018/U+2019 and U+201C/U+201D for quotes) are the conventional choice and match the Unicode Standard's guidance. The decisive drawback is that the converted text stops matching its ASCII equivalent. That breaks code, exact searches and any system expecting straight quotes.

Use plain ASCII for source code, configuration files, command lines, data meant for matching or import, identifiers, URLs and file names. Also use ASCII for text messages where length matters and for systems where UTF-8 handling is not confirmed. If both forms will appear in the same system, normalize apostrophes before searching or comparing text, or keep a plain-text version alongside the typeset one.

What this guide could not verify

The code points, byte sequences and entities above come from the Unicode, UTF-8 and HTML specifications. This guide is not based on test results for specific apps, platforms, messaging services or screen readers. Behavior in a particular destination should be confirmed with that product's documentation or a direct test before you rely on it.