Identify the apostrophe character code

Which apostrophe is in your text? Compare U+0027, U+2019 and look-alikes, with HTML, Unicode and keyboard codes, and learn when the straight apostrophe is safer.

Two different characters both get called "the apostrophe": the straight typewriter apostrophe (') and the curly typographic apostrophe (’). They look similar but have different code points. Which one you have affects code, search, data matching and how text survives copying. This review covers how to tell them apart, what each code is, and when each one fits.

Quick answer: the two main apostrophe codes

Character | Unicode name | Code point | Decimal | HTML reference | UTF-8 bytes
' | APOSTROPHE | U+0027 | 39 | ' or ' | 27
’ | RIGHT SINGLE QUOTATION MARK | U+2019 | 8217 | ’ or ’ | E2 80 99

U+0027 is the ASCII apostrophe that a standard keyboard types. U+2019 is the curly form used in typeset text. The Unicode Standard says U+2019 is the preferred character for the apostrophe as punctuation, as in "don’t". U+0027 is still the safe default anywhere ASCII is expected. The named entity ' is defined in XML and HTML5 but not in older HTML 4, so the numeric ' is the more portable choice.

Look-alike characters that are often mistaken for an apostrophe

Character | Unicode name | Code point | Typical legitimate use
‘ | LEFT SINGLE QUOTATION MARK | U+2018 | Opening single quote; often wrongly produced by auto-correction at the start of a word, as in ‘90s
ʼ | MODIFIER LETTER APOSTROPHE | U+02BC | An apostrophe that works as a letter in some orthographies and transliterations
ʻ | MODIFIER LETTER TURNED COMMA | U+02BB | Used for the ʻokina in Hawaiian
` | GRAVE ACCENT | U+0060 | Backtick in programming and markup; not an apostrophe
´ | ACUTE ACCENT | U+00B4 | Spacing accent mark; not an apostrophe
′ | PRIME | U+2032 | Feet, minutes of arc, and mathematical notation
' | FULLWIDTH APOSTROPHE | U+FF07 | Fullwidth form used alongside East Asian text

Some of these can render almost identically in a given font, so appearance alone is not a reliable test. The only way to be sure is to check the code point.

How to identify which apostrophe you have

Paste the character into any Unicode inspector or code point lookup tool. Search terms such as "Unicode character inspector" or "what Unicode character is this" find them. The tool should report the code point, for example U+2019, along with the official name. You can also check it yourself without a third-party site:

// Browser developer console (JavaScript)
"’".codePointAt(0).toString(16)   // "2019"
"'".codePointAt(0)                // 39

# Python
hex(ord("’"))                     # '0x2019'
import unicodedata
unicodedata.name("’")             # 'RIGHT SINGLE QUOTATION MARK'

Visual clues help when no tool is at hand. A straight apostrophe is vertical or slightly tapered and identical at the start and end of a word. A curly apostrophe looks like a raised comma. If a mark curves the other way, like a small 6, it is probably U+2018, the opening quote, rather than an apostrophe.

How to type each form

  • Straight apostrophe (U+0027): the apostrophe key on a standard US keyboard.
  • Curly apostrophe (U+2019) on macOS with the US layout: Option + Shift + ] (Option + ] produces the opening quote U+2018).
  • Curly apostrophe on Windows: hold Alt and type 0146 on the numeric keypad; this uses the Windows-1252 code page, where position 146 (hex 92) maps to U+2019.
  • In HTML: ’ or ’ for the curly form, ' for the straight form.
  • In code escapes: \u2019 in JavaScript, Java and Python string literals; \2019 in CSS content values.

Many word processors and mobile keyboards apply "smart quotes" automatically and replace the straight apostrophe with U+2019 as you type. If you need the straight form, turn off that auto-format option, or undo the replacement right after it happens. The exact menu location varies by application and version, so search the program's help for "smart quotes" rather than relying on a fixed path.

What changing the apostrophe actually changes

Swapping a straight apostrophe for a curly one is a stored character substitution, not a font or styling effect. The underlying text contains a different code point. Any program that compares, searches, sorts or parses the text sees two different characters, and "don't" and "don’t" are different strings to a computer. This is unlike CSS styling, where the stored text stays the same and only its appearance changes. A font can make U+0027 look curly, but it remains U+0027 when copied.

The distinction also matters for reverse-text tools. Character reversal keeps each code point as it is. "don’t" reversed becomes "t’nod", and the curly mark keeps its original orientation, which can look out of place. A straight apostrophe has no orientation, so it looks the same either way.

Will it stay usable after copying or sharing?

  • Code and command lines: programming languages, shells, JSON, SQL and config files recognize only U+0027 (and U+0022) as quote delimiters. A curly apostrophe pasted from a document or chat into code usually causes a syntax error or an unterminated string.
  • Search and matching: a search, filter or database lookup for a word with one apostrophe form may not match text stored with the other, unless the system normalizes them. Whether a particular search engine or app treats them as equivalent has to be checked in that system; no general rule can be assumed.
  • Encoding errors: U+2019 is three bytes in UTF-8. If those bytes are misread as Windows-1252, the apostrophe appears as "’", a common sign of an encoding mismatch. U+0027 is a single ASCII byte and avoids this problem.
  • Usernames, passwords, file names and form fields: a curly apostrophe can make an entry fail validation or fail to match a value someone typed with the straight key.
  • Assistive technology: screen readers may announce the two forms differently, or not at all, depending on the product and its punctuation settings. No scoped test results were available for this review, so test with the specific screen reader your audience uses if pronunciation matters.

Is the curly apostrophe suitable for your use?

For published prose such as articles, books, marketing copy and typeset documents, the curly apostrophe (U+2019) is the typographically correct choice and matches Unicode's recommendation. Its main benefit is polish and consistency with curly quotation marks. The main tradeoff is portability: it is a non-ASCII character that breaks code, can defeat exact-match searches, and can turn into garbled characters when encodings are mishandled.

Plain U+0027 is the better choice for source code, command-line input, data files, identifiers, form input, email subject lines in uncertain systems, and anything another program will parse or match. If you publish curly apostrophes but users may copy text into technical contexts, provide a plain-text version or code block that uses straight apostrophes. When the apostrophe works as a letter in a language's spelling, U+02BC (or U+02BB for the ʻokina) is the appropriate character, not either punctuation form.

Evidence gaps

The code points, names, encodings and language functions described above come from the Unicode Standard and standard language behavior. This review does not include tested results for specific search engines, social platforms, messaging apps or screen readers. Behavior in those environments should be verified directly rather than assumed from one successful paste.