How to Type an Apostrophe with Alt Codes

Alt codes for the straight apostrophe (Alt+39) and the curly apostrophe (Alt+0146) on Windows, with steps, a before-and-after example, and ways to check which character you typed.

An alt code lets you enter a character on Windows by holding the Alt key and typing a number on the numeric keypad. For apostrophes, the code you need depends on which apostrophe you want. The straight (typewriter) apostrophe and the curly (typographic) apostrophe are different characters, and the difference matters in code, data files, and search.

Which apostrophe alt code do you need?

Character | Name | Unicode code point | Alt code (Windows) | Typical use
' | Apostrophe (straight) | U+0027 | Alt+39 | Code, file names, CSV and other data, command lines, plain-text fields
’ | Right single quotation mark (curly apostrophe) | U+2019 | Alt+0146 | Typeset prose, such as don’t, it’s, the 1990’s
‘ | Left single quotation mark | U+2018 | Alt+0145 | Opening a single-quoted phrase, not used as an apostrophe

The leading zero in Alt+0146 is significant. Codes without a leading zero, such as Alt+39, come from the older OEM code page. Codes with a leading zero, such as Alt+0146, come from the system's ANSI code page, which is Windows-1252 on standard US English Windows. On a system set to a different ANSI code page, Alt+0146 may produce a different character, so check the result as described below.

In English text, the curly apostrophe is the same character as the closing single quotation mark (U+2019). No separate apostrophe-only curly character is in common use.

What you need before you start

  • A Windows computer. Alt codes as described here are a Windows input feature.
  • A numeric keypad. The number keys above the letters do not work for alt codes.
  • Num Lock turned on.
  • A text field that accepts keyboard input. Some applications intercept Alt key combinations for menus, which can stop the code from working.

Steps to type an apostrophe with an alt code

  • 1. Place the cursor where the apostrophe should go.
  • 2. Make sure Num Lock is on.
  • 3. Press and hold the left Alt key.
  • 4. On the numeric keypad, type 39 for a straight apostrophe or 0146 for a curly apostrophe.
  • 5. Release Alt. The character appears when you let go of the key.
  • 6. Check which character was inserted (see the next section).

On laptops without a dedicated keypad, some keyboards provide an embedded numeric keypad on the letter keys, usually turned on with Fn or a Num Lock key. Whether one exists, and how it is labeled, depends on the keyboard model, so check the key legends or the manufacturer's documentation. If no keypad is available, the Windows Character Map utility or the Word method below are alternatives.

Before-and-after example

The following is an illustrative example, not captured output. It shows the same word with each apostrophe inserted at the position marked by the cursor.

Before:            dont
Alt+39 after n:    don't    (U+0027 straight apostrophe)
Alt+0146 after n:  don’t    (U+2019 curly apostrophe)

The two results look similar in many fonts, but they are different characters. A search for don't with a straight apostrophe will not match don’t with a curly one unless the search tool normalizes apostrophes.

How to check which apostrophe you typed

  • Compare the shapes in a font that clearly distinguishes them. The straight apostrophe is a vertical tick, while the curly apostrophe resembles a small raised comma.
  • In Microsoft Word, place the cursor immediately after the character and press Alt+X. Word replaces the character with its hexadecimal code, which is 0027 for the straight apostrophe or 2019 for the curly one. Press Alt+X again to convert the code back into the character.
  • In a code editor or hex viewer, check the underlying value. In UTF-8, the straight apostrophe is the single byte 27, and the curly apostrophe is the three bytes E2 80 99.

Typing the curly apostrophe in Word without an alt code

Word can insert a character from its Unicode code point. Type 2019 and then press Alt+X, and Word converts the four digits into ’. This method does not need a numeric keypad. It also does not depend on the ANSI code page, because it uses the Unicode value directly. If the digits run into preceding letters or numbers, Word may read too many characters, so add a space first or select only the code before pressing Alt+X.

When autocorrect changes your apostrophe

Word processors and some other applications have a smart quotes option, which replaces straight quotes with curly quotes as you type. With this option on, a straight apostrophe you meant to keep may be converted. Pressing Ctrl+Z immediately after an automatic correction in Word undoes that correction and keeps the original character. To stop the conversion entirely, turn off the smart quotes option in the application's autocorrect settings. The exact menu location varies by application and version.

Avoiding unintended changes in bulk edits

If you plan to convert apostrophes throughout an existing document with find and replace, keep in mind that U+2019 is used both as the apostrophe and as the closing single quotation mark. Replacing every ’ with ' will also change closing quotes. Replacing every ' with ’ can also alter code samples, file paths, and measurements written with straight marks, such as 5' for feet. Save a copy before running a document-wide replacement. Review matches one at a time where the text mixes prose with code or data, and confirm any changes in code or data against the original.

Limits of this guide

The behavior described here reflects standard Windows alt code input and documented Word features. It has not been tested against specific applications or keyboard models for this article. Some programs handle Alt key input differently or block it, and results with non-US code pages can differ from the table above. If the inserted character is not what you expected, use the checking methods above to confirm what was actually entered.