Computer Keyboards Codexery

Alt code

A legacy method for entering characters via numeric keypad.

Alt code

Alt code is a method for entering characters that lack a dedicated key on a keyboard, used on personal computers with numeric keypads running Microsoft operating systems such as Windows. It is notable for its longevity, having originated in the BIOS of IBM PC compatible computers from the 1980s and been preserved in later systems due to user familiarity.

Origin system
IBM PC compatible personal computers from the 1980s
Original code page
CP437
Common alternative code page
CP850
Windows oem behavior
Alt+### generates characters from legacy OEM code pages
Windows unicode behavior
Alt+0### produces characters using the Windows code page associated with the current input locale
Unicode limit in some apps
numbers from 256 to 65,535 produce the corresponding Unicode character
Hex input requires
registry key HKEY_CURRENT_USER\Control Panel\Input Method, value EnableHexNumpad set to 1

Lore & Background

On IBM PC compatible personal computers from the 1980s, the BIOS allowed users to hold down the Alt key and type a decimal number on the keypad, placing the corresponding code into the keyboard buffer. Applications reading keystrokes from the BIOS would often interpret the code as an 8-bit character from the current code page, such as CP437 on the original IBM PC. Some Eastern European, Arabic and Asian computers used other hardware code pages, and MS-DOS could switch between them at runtime with commands like KEYB, CHCP or MODE, causing Alt combinations to produce different characters. PC keyboards designed for non-English use included other methods like national keyboard layouts, the AltGr key or dead keys, but the Alt key remained popular as the only method that was the same on all machines.

In the ASCII standard, numbers 0-31 and 127 are assigned to control characters; for instance, code point 7 is typed by Ctrl+G. While some applications would insert a bullet character • (code point 7 on code page 437), some would treat this identical to Ctrl+G, which often was a command for the program. Microsoft preserved Alt codes in Windows, where the familiar Alt+### combination retains the old MS-DOS behavior, generating characters from legacy OEM code pages. The new Alt+0### combination produces characters using the Windows code page associated with the current input locale, such as Alt+0163 resulting in £ when CP1252 is active.

Later versions of Windows and applications such as Microsoft Word added support for Unicode, with the benefit that old Alt combinations for line-drawing characters worked again. In the IBM PC BIOS, typing an Alt code greater than 255 produced the same as that number modulo 256; some applications retained this behavior, while others (notably those using the Windows RichEdit control, such as WordPad and PSPad) made numbers from 256 to 65,535 produce the corresponding Unicode character. Windows also added a mechanism to input Alt codes in hexadecimal form by setting a registry value, though this did not work in all applications or user interface elements.

Reader's Guide

The Alt code method is significant because it bridged the gap between legacy MS-DOS character entry and modern Windows systems, preserving user familiarity with memorized numeric combinations. In Windows, the distinction between Alt+### (OEM code pages) and Alt+0### (Windows code page) allowed users to access both legacy and locale-specific characters. The method's adaptation to Unicode in later Windows versions and applications like Microsoft Word and WordPad extended its usefulness, enabling entry of characters up to code point 65,535. The addition of hexadecimal input via registry modification provided a way to enter Unicode characters using their more common hexadecimal representation, though limited to the Basic Multilingual Plane. Despite its limitations—such as requiring Num Lock to be enabled and not working on ChromeOS, macOS, or Linux—the Alt code method remained a widely known and used input technique on Windows platforms, emulated by many pieces of software that do not use the BIOS keyboard decoding.

Did You Know?

The BIOS Era: Where Alt Codes Were Born

In the 1980s, IBM PC-compatible machines gave users a clever trick baked directly into the BIOS. By holding the Alt key and punching a decimal number on the numeric keypad, a user could inject a specific code into the keyboard buffer, making it appear to software as though a single keystroke had occurred. Programs reading from the BIOS would then decide what to do with that code—treating it either as a command or as an 8-bit character drawn from the active code page. The original IBM PC used CP437, but machines in Eastern Europe, the Arab world, and Asia shipped with different hardware code pages, and MS-DOS offered runtime commands like KEYB, CHCP, and MODE to switch between them. CP850 became a popular choice for Latin-script locales needing more accented variants. Even though national keyboard layouts, the AltGr key, and dead keys offered alternative routes to special characters, the Alt-key method remained the one universal technique that worked identically on every machine, which is why it stuck in users' muscle memory for decades to come.

Windows' Dual Code Page Legacy

When Microsoft built Windows, users had already memorized their favorite Alt combinations so thoroughly that the company chose to preserve them rather than abandon the tradition. The result was a dual system. The classic Alt-plus-number sequence kept its old MS-DOS behavior, pulling characters from the legacy OEM code pages such as CP437 or CP850—so Alt+163 still yielded ú. The OEM code page setting in Windows served almost no other purpose beyond dictating what those legacy Alt codes would produce; it did not alter how existing text on screen was displayed, a notable departure from character-mode MS-DOS. A second, zero-prefixed variant—Alt+0###—tapped into the Windows code page tied to the user's current keyboard locale. Under CP1252, for example, Alt+0163 produced the pound sign £ instead. This split meant that the same numeric position could map to entirely different glyphs depending on which path the user took, and certain characters like box-drawing symbols simply could not be reached at all if they were absent from the active Windows code page.

The Unicode Leap and Hexadecimal Input

Later Windows releases and applications like Microsoft Word brought Unicode into the picture, and with it a remarkable revival: old Alt combinations that once produced line-drawing characters suddenly worked again. Because CP1252 maps code points 32 through 126 and 160 through 255 identically to Unicode, zero-prefixed Alt codes on CP1252 layouts naturally produced the matching Unicode characters. For values above 255, the old BIOS simply wrapped the number modulo 256, but applications built on the Windows RichEdit control—WordPad and PSPad among them—went further, letting numbers from 256 up to 65,535 generate the corresponding Unicode character. Typing Alt+9731 in WordPad, for instance, yields the snowman glyph U+2603, since 9731 in decimal equals 2603 in hexadecimal. Recognizing that most Unicode tables list code points in hex, Windows added a dedicated hexadecimal input mode. After enabling a registry flag called EnableHexNumpad and rebooting, a user holds Alt, presses the plus key on the numpad, then enters hex digits on the keypad and letters A through F on the main keyboard. The value accumulates into a 16-bit field, capping input at the Basic Multilingual Plane.

Beyond Windows: Cross-Platform Realities and Quirks

The Alt-key numpad method is firmly a Windows and MS-DOS tradition. There is no evidence that ChromeOS, macOS, or Linux distributions have shown interest in replicating it, and the technique simply does not function on those platforms. Unix and Unix-like systems do offer a comparable numeric entry path, however: pressing and releasing Ctrl+Shift+U, typing the hexadecimal code point, and confirming with the space bar or Enter key. Entering AE after the shortcut produces the registered trademark symbol ®, while 26D4 yields the no-entry sign ⛔. Even within Windows, the method carries practical pitfalls. If Num Lock is turned off, the numeric keypad keys double as navigation controls, so an attempted Alt+4 can be misread as Alt+Left Arrow, sending a web browser back a page rather than inserting the intended character. Users who rely heavily on Alt codes must therefore keep Num Lock engaged, and those seeking characters outside the Alt-code range can turn to alternatives such as the built-in Character Map utility or the various Unicode input methods available in modern applications.

Frequently Asked Questions

What is Alt code?

Alt code is a legacy input technique where you hold the Alt key and punch in a number on the numeric keypad to summon a character that has no dedicated key of its own. It is a holdover from the IBM PC era that persists on modern Windows machines.

Where did Alt code originally come from?

The method was baked into the BIOS firmware of IBM PC-compatible computers in the 1980s, initially pulling glyphs from the CP437 code page. Later hardware and OS versions shifted to CP850 as the more common legacy code page.

How does Alt code actually map numbers to characters on Windows?

Pressing Alt plus a three-digit number causes Windows to look up the character in the legacy OEM code page tied to your current input locale. Adding a leading zero (Alt+0###) switches the lookup to the Windows code page for that locale, and in some applications values from 256 through 65,535 resolve to the matching Unicode character.

Why hasn't Alt code been removed after all these decades?

Microsoft kept the feature alive primarily out of user familiarity—decades of people who learned the trick in the 1980s and 1990s still expect it to work. Its survival is less about technical necessity and more about not breaking a deeply ingrained habit.

Do I need a special keyboard to use Alt code?

Yes, the technique specifically requires a numeric keypad, so compact or laptop keyboards without a dedicated numpad section can't trigger it directly. It is designed for personal computers running Microsoft operating systems that include that separate number-entry area.

More in Computer Keyboards 1-24

Spotted an error? Know more?

Reader corrections go straight into our review queue. Suggest an edit · How this site is sourced

Comments

Loading…
Open in the interactive codex →