What Are Alt Codes and How to Use Them
A Technical Guide to Keypad Character Entry in Windows
IBM introduced Alt codes in 1981 with MS-DOS 1.0 to let users type characters not present on standard physical keyboard keys. Holding down the left Alt key while entering a decimal value on the numeric keypad sends character code signals directly to the operating system's keyboard buffer. Modern Windows environments still support this low-level input mechanism, though the resulting symbol depends heavily on whether you type a leading zero before the numeric sequence.
The Hardware and OS History Behind Alt Key Combinations
MS-DOS version 1.0 relied on BIOS interrupt 16h to capture keystrokes from the IBM PC 83-key Model F keyboard. When IBM engineers designed the original PC in 1981, keyboard layouts lacked dedicated keys for non-English letters, box-drawing glyphs, and mathematical symbols. To bypass this hardware constraint, the ROM BIOS keyboard driver included a routine: if the user held the left Alt key while typing a three-digit decimal number between 1 and 255 on the dedicated numeric keypad, the BIOS calculated the binary byte value and placed it into the keyboard buffer as an ASCII or extended ASCII character.
This mechanism bypassed standard key-mapping tables entirely. Instead of generating a standard scan code associated with a specific key cap, the system assembled a single 8-bit byte from the decimal key presses once the Alt key was released. Text-mode software running on early video hardware like the Monochrome Display Adapter (MDA) or Color Graphics Adapter (CGA) read this byte directly from memory address 0x0040:0x001E and displayed the corresponding glyph from the video card font ROM. Because this pipeline operated below the application software layer, Alt codes provided a universal fallback across word processors, command line prompts, and database software.
OEM vs. ANSI: Why the Leading Zero Changes Everything
Code Page 437 served as the default OEM character sets on original IBM PC systems sold in the United States. When Microsoft introduced Windows 1.0 and later Windows 3.1, the operating system adopted a dual character encoding model to maintain backward compatibility with legacy DOS software while supporting GUI applications. This architectural decision created two distinct pathways for processing Alt key numeric sequences: legacy OEM codes and Windows ANSI codes.
Typing an Alt code without a leading zero instructs Windows to process the decimal number using the system's hardware-bound OEM code page. For example, typing Alt + 130 inputs the character é if your system uses Code Page 437 or Code Page 850. However, typing an Alt code with a leading zero (such as Alt + 0130) instructs Windows to interpret the decimal sequence using the active Windows ANSI code page, typically Windows-1252 in Western English and European installations. In Windows-1252, decimal 130 maps to a single low quotation mark ‚, whereas decimal 169 with a leading zero (Alt + 0169) generates the copyright symbol ©.
Knowing this distinction prevents corruption when editing configuration files or source code across mixed environments. Our alt codes reference directory documents both encoding routes side-by-side. If a script written on an English OEM system expects CP437 character 168 (¿) via Alt + 168, entering Alt + 0168 on Windows-1252 yields ¨ (diaeresis), causing unexpected parsing errors or leading to mojibake in legacy databases.
How Modern Windows Translates Alt Sequences to Unicode
Windows NT 3.1 transitioned the core operating system architecture to 16-bit Unicode (UTF-16) in 1993. To preserve support for legacy hardware, the Windows keyboard subsystem continues to accept decimal Alt codes, converting the legacy byte values into 16-bit UTF-16 code units on the fly. When you type Alt + 0128 in a modern application like Notepad or Visual Studio Code, the OS converts decimal 128 from Windows-1252 to UTF-16 code point U+20AC (€).
In addition to legacy 8-bit mapping, Windows includes an optional registry setting that enables direct input of hexadecimal Unicode values. By adding a String value named EnableHexNumpad with a value data of 1 under the registry key HKEY_CURRENT_USER\Control Panel\Input Method, users can type arbitrary Unicode characters up to U+FFFF. To use this mode, hold Alt, press the plus key + on the numeric keypad, type the hexadecimal code point (such as 03B1 for Greek alpha α), and release Alt.
Windows evaluates Alt input according to a strict lookup hierarchy:
- Hexadecimal Unicode mode (if
EnableHexNumpadis active and the+key was pressed first). - Windows ANSI code page lookup (if the decimal sequence begins with a leading zero).
- OEM code page lookup (if the decimal sequence begins with a non-zero digit between 1 and 255).
- Low ASCII control code translation (if the decimal sequence is between 1 and 31 without a leading zero).
For standard 7-bit ASCII characters (values 32 through 127), both OEM and ANSI mappings produce identical output. Alt + 65 produces uppercase A, matching decimal 65 across every standard character table.
Step-by-Step Execution and System Requirements
Entering an Alt code requires specific hardware behavior that is not present on all modern input devices. The operating system monitors lower-level scan codes generated specifically by the dedicated numeric keypad, which transmit distinct scan codes from the top-row number keys.
To enter an Alt code on a standard full-sized PC keyboard:
- Verify that the Num Lock key is enabled. The Num Lock indicator light on your keyboard must be lit; otherwise, keypresses on the numeric keypad emit navigation commands (such as Home, Page Up, or Arrow keys) instead of numeric digits.
- Press and hold down the left Alt key. While some Windows builds process the right Alt key identically, using the left Alt key avoids conflicts with AltGr (Alternate Graphic) layouts found on international keyboards.
- Type the complete decimal sequence on the numeric keypad. Do not use the row of number keys located above the QWERTY letter keys.
- Release the Alt key. Windows evaluates the accumulated numeric buffer upon the key release event and inserts the corresponding code point into the focused input field.
Common Pitfalls, Laptops, and Cross-Platform Limitations
Compact laptop keyboards lacking a physical 10-key numeric pad cannot generate standard Alt codes directly. Laptop manufacturers frequently map the Fn key to emulate a numeric keypad across letter keys like J, K, L, and U. However, if your laptop lacks both a physical numpad and an Fn-based numpad overlay, holding Alt while pressing top-row number keys will not trigger the Windows Alt code handler. On such machines, alternative entry methods like the Windows Character Map (charmap.exe), the Emoji Panel (Win + .), or custom software key-remappers must be used instead.
Cross-platform compatibility presents another limitation. macOS does not support Windows Alt key numeric sequences. Apple keyboards utilize the Option key (labeled Alt on some Mac layouts) in combination with letter and symbol keys to input special characters. For instance, Option + g produces © on a Mac, whereas Windows requires Alt + 0169. Similarly, Linux environments rely on the Compose key or the Ctrl + Shift + U hex input shortcut rather than decimal Alt codes.
Software-level keyboard hooks can also interfere with Alt code processing. Web browsers, screen readers, and developer environments sometimes capture Alt key combinations for application shortcuts before the OS keyboard driver finishes building the numeric buffer. If Alt + 0169 opens an application menu or triggers a menu bar focus state, the application has intercepted the keydown events prematurely.
Practical Alt Code Reference Table
The table below lists frequently used Alt codes, showing both OEM and ANSI code page values alongside their modern Unicode equivalents. Refer to our ASCII keyboard guide for detailed hardware keycodes.
| Glyph | Description | OEM Code (No Zero) | ANSI Code (Leading Zero) | Unicode Hex Code Point |
|---|---|---|---|---|
© |
Copyright Symbol | N/A | Alt + 0169 | U+00A9 |
® |
Registered Trademark | N/A | Alt + 0174 | U+00AE |
™ |
Trademark Symbol | N/A | Alt + 0153 | U+2122 |
° |
Degree Sign | Alt + 248 | Alt + 0176 | U+00B0 |
± |
Plus-Minus Sign | Alt + 241 | Alt + 0177 | U+00B1 |
µ |
Micro Sign / Mu | Alt + 230 | Alt + 0181 | U+00B5 |
¢ |
Cent Sign | Alt + 155 | Alt + 0162 | U+00A2 |
€ |
Euro Sign | N/A | Alt + 0128 | U+20AC |
ñ |
Small N with Tilde | Alt + 164 | Alt + 0241 | U+00F1 |
¿ |
Inverted Question Mark | Alt + 168 | Alt + 0191 | U+00BF |
α |
Greek Lowercase Alpha | Alt + 224 | N/A | U+03B1 |
│ |
Box Drawings Light Vertical | Alt + 179 | N/A | U+2502 |
References
- Microsoft Support: OEM and ANSI Code Pages in Windows Input Architecture
- IBM Personal Computer Technical Reference Manual (1981), Keyboard Subsystem and ROM BIOS Interrupt 16h Specifications
- Unicode Consortium: Unicode Technical Note #28 - Unicode Input Methods
- ISO/IEC 8859-1:1998 Information technology - 8-bit single-byte coded graphic character sets - Part 1: Latin alphabet No. 1