Straight and curly apostrophes: ASCII, Unicode and UTF-8 codes
Straight vs curved apostrophe: ASCII 39 and U+0027 vs U+2019, their UTF-8 bytes, why "ASCII 146" is really Windows-1252, and when converting between them is safe.
The short answer
The straight apostrophe (') is ASCII code 39, hexadecimal 27, Unicode U+0027 APOSTROPHE. In UTF-8 it is the single byte 27. The curved or curly apostrophe (’) is not part of ASCII at all. It is Unicode U+2019 RIGHT SINGLE QUOTATION MARK, decimal 8217, encoded in UTF-8 as the three bytes E2 80 99. The number 146 that often appears in searches for the curly apostrophe is its byte value in the Windows-1252 code page, not an ASCII code.
Is converting apostrophes right for your use?
Converting straight apostrophes to curly ones suits prose that people will read as finished text: articles, books, print layouts and edited web copy, provided every step of the pipeline handles UTF-8. The main benefit is conventional typography. The decisive tradeoff is that the curly apostrophe is a different character, so any software that compares characters exactly treats don’t and don't as two different strings.
Keep the straight apostrophe, or keep a straight-apostrophe version alongside the typeset one, in these situations:
- Source code, shell commands, configuration files and regular expressions, where U+0027 is syntax.
- Data that will be matched or looked up: database keys, spreadsheet lookups, tags, usernames and passwords.
- Filenames, URL slugs and identifiers.
- Text headed to systems whose encoding is uncertain or limited, such as older email setups or SMS.
- Any field where people will type a search query, since they will almost always type the straight form.
What the conversion actually changes
Apostrophe conversion is a character substitution, not a styling effect. A smart-quote tool replaces U+0027 with U+2019 (or with U+2018 where it decides a single quotation is opening) in the stored text. Each converted apostrophe grows from one byte to three in UTF-8. Straightening does the reverse and is equally a stored change.
A font cannot do this. A font only decides how a given character looks. Some typefaces draw U+0027 with a slant or wedge shape that can pass for a curved apostrophe on screen, while some monospaced fonts draw U+2019 nearly vertical. The shape is therefore not a reliable test; the code point is.
CSS cannot turn a typed straight apostrophe into a curly one either. The CSS quotes property controls the marks generated around q elements and by open-quote and close-quote content values; it does not alter apostrophes inside text. If a web page shows curly apostrophes, the curly characters are in the HTML, either literally or as entities, or the font is drawing the straight character with a curved shape.
Terminology varies but points to the same two characters. Curly, curved, smart, typographic and book apostrophe usually mean ’ (U+2019). Straight, typewriter, vertical and dumb apostrophe usually mean ' (U+0027).
Code reference
| Character | Unicode name | Code point | Decimal | UTF-8 bytes | HTML | Windows-1252 byte |
| ' | APOSTROPHE | U+0027 | 39 | 27 | ' or ' | 39 (hex 27) |
| ’ | RIGHT SINGLE QUOTATION MARK | U+2019 | 8217 | E2 80 99 | ’ or ’ | 146 (hex 92) |
| ‘ | LEFT SINGLE QUOTATION MARK | U+2018 | 8216 | E2 80 98 | ‘ or ‘ | 145 (hex 91) |
| ʼ | MODIFIER LETTER APOSTROPHE | U+02BC | 700 | CA BC | ʼ | not available |
The named entity ' is defined in XML and HTML5 but not in HTML 4; the numeric form ' works in all of them.
Apostrophe vs single quote in ASCII and Unicode
ASCII has only one character for this job. Code 39 serves as the apostrophe, the opening single quote and the closing single quote. That is why the ASCII apostrophe and the ASCII single quote are the same thing, and why programming languages use it as a string delimiter.
Unicode separates opening and closing single quotation marks, but it does not give the English apostrophe its own punctuation character. The Unicode Standard recommends U+2019, the right single quotation mark, for the apostrophe. So in typeset English, the apostrophe and the closing single quote are the same code point. The character to avoid in contractions and possessives is U+2018, the opening mark.
U+02BC MODIFIER LETTER APOSTROPHE is intended for orthographies where the apostrophe functions as a letter, such as marking a glottal stop. It is not the standard choice for English contractions or possessives, and because it is classed as a letter it can behave differently in word selection and search.
Several other characters look similar but are not apostrophes and should not be substituted for one:
- ` U+0060 GRAVE ACCENT, the backtick, which has its own meaning in code and Markdown.
- ´ U+00B4 ACUTE ACCENT, a spacing diacritic.
- ′ U+2032 PRIME, used for feet, minutes and arcminutes.
Why "ASCII 146" keeps coming up
ASCII defines 128 codes, numbered 0 to 127, so 146 cannot be an ASCII code. In the Windows-1252 code page, the default for Western European languages on Windows, byte 146 (hex 92) is the curly apostrophe. Typing Alt+0146 on the numeric keypad in Windows produces ’ because Alt codes with a leading zero use the system's Windows code page, which is Windows-1252 on US systems.
The same byte means something else elsewhere. In ISO-8859-1 it is an invisible control character, and in UTF-8 a lone byte 92 is invalid. This explains two familiar kinds of garbled text. Windows-1252 text opened as UTF-8 can show a replacement character (�) where apostrophes were. UTF-8 text opened as Windows-1252 shows the three bytes E2 80 99 as ’. Both are encoding mismatches. The reliable fix is to read or convert the file with its correct encoding; search-and-replace on the garbled sequence is a patch that can miss other affected characters.
Entering each character
Windows, numeric keypad: Alt+0146 -> ’ Alt+0145 -> ‘
macOS, US layout: Option+Shift+] -> ’ Option+] -> ‘
Many Linux desktops: Ctrl+Shift+U, then 2019, then Enter -> ’
HTML: ’ ’ ’
CSS content value: "\2019"
JSON, JavaScript, Python: "\u2019"
URL percent-encoding: %E2%80%99
Straight apostrophe, HTML: ' '
Straight apostrophe, URL: %27
The Linux shortcut depends on the input method and toolkit in use, so it does not work in every application.
Checking which apostrophe you have
Because fonts can disguise the difference, inspect the code points. Any character inspector will do; in Python, for example:
>>> [hex(ord(c)) for c in "don’t"]
['0x64', '0x6f', '0x6e', '0x2019', '0x74']
>>> [hex(ord(c)) for c in "don't"]
['0x64', '0x6f', '0x6e', '0x27', '0x74']
Errors to watch for in automatic conversion
- Leading apostrophes turned the wrong way. A converter that sees an apostrophe at the start of a word often treats it as an opening quote, producing ‘90s, ‘til or rock ‘n’ roll instead of ’90s, ’til and rock ’n’ roll. These need a manual check.
- Conversion inside code. Inline code, code blocks, HTML attributes and URLs should be excluded, or the result will no longer run or resolve.
- Measurements. Feet and inches written as 5'11" should become primes (5′11″) or stay straight, not turn into curly quotes.
- Ambiguous quotes. A converter cannot always tell an opening single quote from a leading apostrophe; it relies on heuristics.
- Lossy straightening. Converting everything to U+0027 discards the opening and closing distinction, and restoring it means running those heuristics again. Keeping a source version avoids repeated round trips.
- Language settings. Quotation conventions differ between languages, so a converter configured for English may choose the wrong marks in other languages.
Will the text stay usable after copying or sharing?
Copy and paste carries the character itself, so a curly apostrophe stays curly between applications that handle UTF-8 correctly. Problems appear in a few predictable places.
Code and commands. Pasting a command or snippet containing curly quotes into a terminal or code editor typically causes a syntax error, because the language expects U+0027. Documentation or messages that pass code through a smart-quote converter are a known source of commands that fail when copied.
Search and matching. Exact-match operations compare code points, so a search for don't will not find don’t unless the software folds the two together. Unicode normalization does not help here: neither NFC nor NFKC maps U+2019 to U+0027. Some search tools do treat them as equivalent, but no evidence was available for this review on which specific search engines, browsers, CMS search features or databases do so. Testing both forms in the destination is the only safe check.
Editing destinations that convert on their own. Word processors and some mobile keyboards apply smart punctuation as you type, so straight apostrophes may become curly without anyone choosing to convert them. Whether a given app does this on paste as well as on typing depends on the app and its settings, and was not tested here.
SMS. The GSM 7-bit default alphabet used for standard text messages includes the straight apostrophe but not U+2019. Under the standard, a single character outside that alphabet usually switches the whole message to UCS-2 encoding, which lowers the single-message limit from 160 characters to 70. Some gateways substitute characters instead; behavior for a particular carrier or sending service was not verified.
Filenames and URLs. A curly apostrophe in a URL is percent-encoded as %E2%80%99, which is hard to read and easy to mistype. Slugs and filenames are simpler without it.
Accessibility and reading order. Both apostrophes are neutral characters for bidirectional text, so conversion does not change reading order. How a screen reader announces each form depends on the product and its punctuation verbosity setting. No documentation or tests for specific screen readers were available for this review, so if the distinction matters for your audience, test with the assistive technology they use.
A workable approach
- Keep one master version, and convert at the output stage for each destination rather than editing back and forth.
- Make sure files and pages declare UTF-8 and are actually saved as UTF-8.
- Exclude code, URLs, attributes and data fields from conversion.
- Review leading apostrophes and measurements by hand after converting.
- Where text must be searchable or copyable as commands, provide or retain the straight-apostrophe form.
Limits of this review
No product-specific evidence was supplied. The character codes, byte sequences and encoding behavior above come from the published ASCII, Unicode, UTF-8, Windows-1252 and GSM standards. Statements about how particular apps, search engines, messaging services or screen readers treat the two apostrophes are general, and none of them were tested for this article.