World Library  
Flag as Inappropriate
Email this Article

Alt code

Article Id: WHEBN0003994421
Reproduction Date:

Title: Alt code  
Author: World Heritage Encyclopedia
Language: English
Subject: Character encoding, Dash, ASCII art, Unicode input, Indian rupee sign
Publisher: World Heritage Encyclopedia

Alt code

Animation showing the sequence of keys to press to enter the Alt code 161, producing the character "í" (Latin letter i with acute accent). The Alt key is held down while entering the digits on the numeric keypad.

On IBM compatible personal computers, many characters not directly associated with a key can be entered using the Alt Numpad input method or Alt code: pressing and holding the Alt key while typing the number identifying the character with the keyboard's numeric keypad. Similar or extended forms of this feature are also available in many operating systems, including DOS and Microsoft Windows.

Often this is the best or only method many computer users know for entering non-ASCII characters. Many WorldHeritage articles on various characters will include how to type that character using Alt codes for code page 437.

History and description

Originally on IBM PCs, the user could hold down the Alt key and type a decimal number on the keypad. The system BIOS would place the corresponding code into the keyboard buffer so that, for software using the BIOS for character input, it would look (almost) as if the code had been entered by a single keystroke. Applications reading keystrokes from the BIOS would behave according to what action they associate with that code. Some would interpret the code as a command, but often it would be interpreted as a code to be placed on the screen at the location of the cursor, thus displaying the corresponding 8-bit character from the current code page. Without other software loaded, this is the so-called hardware code page, which is code page 437 for original IBM PCs and most other computer systems using English. Some Eastern European, Arabic and Asian computers use other hardware code pages, however.

When an operating system like DOS was used, it became possible to override the hardware code page with a variety of other code pages and even switch between them at runtime with commands like KEYB, CHCP or MODE. While most English systems still used code page 437 under DOS, another very common choice in locales using variants of the Latin alphabet was code page 850, which provided more Latin character variants than code page 437. There were, however, many more code pages; for a more complete list, see code page.

These numbers became so well known and memorized by computer users that Microsoft was forced to preserve them even though it used a new and different set of code pages for Windows, such as code page 1252. These new code pages were called ANSI code pages by Microsoft, while the old ones were called OEM code pages. Holding Alt and typing three digits (first one non-zero) would attempt to translate the code from the 8-bit OEM code page (for example, code page 850) to a matching glyph in the ANSI code page. A leading zero (0) and then a number would produce the character directly from the ANSI code page.

For instance, the combinationAlt+161 for codepoint 161 would result in "í" (Latin letter i with acute accent) with an OEM code page setting of e.g. 437 or 850. On a Windows system using code page 1252 as ANSI code page, Alt+0161 yields the character "¡" (inverted exclamation) which is at 161 in ANSI code page 1252.

When Windows later transitioned to Unicode, the 0-leading codes had become so well known as well that a third method needed to be invented to produce Unicode codepoints. Although code page 1252 is quite close to the start of Unicode and it would seem logical to just allow larger numbers to be typed, other international sets did not match, and some users were accustomed to numbers larger than 255 being translated modulus 256. Nevertheless, some applications like Word 2010 or PSPad 4.5.6 interpret alt codes larger than 255 directly as a decimal Unicode codepoint.

To enable the third method, a user must set or create the registry key HKCU\Control Panel\Input Method\EnableHexNumpad with type REG_SZ to value 1 and reboot (logging out and logging back in is sufficient). Once the registry key is set, the following method can be used to enter Unicode codepoints:

  • Hold Alt and type the + key on the numeric keypad, then type the hexadecimal number (using the numeric keypad for digits 0-9 and the normal keys for a-f), then release Alt.

For example, Alt++11b will produce "ě" (e with caron).

The transition to Unicode actually made the older legacy Alt codes (the ones with no leading zero) more reliable, as all the glyphs in the legacy code pages have matching glyphs in Unicode, so they all work.

Third-party software can be run on Windows to replace the default keyboard handling to allow more possible ways of input, such as typing in number systems other than base 10. Modern input methods for foreign languages often have much more user-friendly methods of choosing characters, such as picking them off a popup window or using mnemonic sequences of letters, however the Alt key combinations remain very popular and often the only scheme a user knows for entering letters that are not on their keyboard.


If Num lock is disabled, attempting an Alt code may cause unexpected results in some applications. For example, Alt+4 can be taken as Alt+, causing a web browser to go back one page.

Many laptops do not have a separate numeric keypad, but may provide Numpad input by holding a modifier key (typically labelled "Fn"); thus one must press and hold both Alt and Fn keys while entering the character code.


The Alt key method does not work on Linux systems and there seems to be little interest in replicating it, due to it including the dated IBM PC character encoding as part of its definition. Numeric entry of Unicode is done by the application or UI toolkit library has been somewhat standardized though there are slight variations. Sometimes all three of these work (for instance in Firefox):

  • Hold Ctrl+ Shift and type U followed by up to eight hex digits (on main keyboard or numpad). Then release Ctrl+ Shift.
  • Hold Ctrl+ Shift+U and type up to eight hex digits, then release Ctrl+ Shift+U.
  • Type Ctrl+ Shift+U, then type up to eight hex digits, then type Enter.

In Inkscape, for example, only the second method works. In GTK only the third method works.

See also

External links

  • How to enter Unicode characters in Microsoft Windows
  • Windows - Alt Key Numeric Codes
  • Alt Codes
This article was sourced from Creative Commons Attribution-ShareAlike License; additional terms may apply. World Heritage Encyclopedia content is assembled from numerous content providers, Open Access Publishing, and in compliance with The Fair Access to Science and Technology Research Act (FASTR), Wikimedia Foundation, Inc., Public Library of Science, The Encyclopedia of Life, Open Book Publishers (OBP), PubMed, U.S. National Library of Medicine, National Center for Biotechnology Information, U.S. National Library of Medicine, National Institutes of Health (NIH), U.S. Department of Health & Human Services, and, which sources content from all federal, state, local, tribal, and territorial government publication portals (.gov, .mil, .edu). Funding for and content contributors is made possible from the U.S. Congress, E-Government Act of 2002.
Crowd sourced content that is contributed to World Heritage Encyclopedia is peer reviewed and edited by our editorial staff to ensure quality scholarly research articles.
By using this site, you agree to the Terms of Use and Privacy Policy. World Heritage Encyclopedia™ is a registered trademark of the World Public Library Association, a non-profit organization.

Copyright © World Library Foundation. All rights reserved. eBooks from World eBook Library are sponsored by the World Library Foundation,
a 501c(4) Member's Support Non-Profit Organization, and is NOT affiliated with any governmental agency or department.