Skip to content
Surf Wiki
Save to docs
general/character-encoding

From Surf Wiki (app.surf) — the open knowledge base

Alt code

Input method


Input method

On personal computers with numeric keypads that use Microsoft operating systems, such as Windows, many characters that do not have a dedicated key combination on the keyboard may nevertheless be entered using the Alt code (the Alt numpad input method). This is done by pressing and holding the key, then typing a number on the keyboard's numeric keypad that identifies the character and then releasing .

MS-DOS

On IBM PC compatible personal computers from the 1980s, the BIOS allowed the user to hold down the key and type a decimal number on the keypad. It would place the corresponding code into the keyboard buffer so that 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 an 8-bit character from the current code page that was inserted into the text the user was typing. On the original IBM PC the code page was CP437.

Some Eastern European, Arabic and Asian computers used other hardware code pages, and MS-DOS was able to switch between them at runtime with commands like KEYB, CHCP or MODE. This causes the Alt combinations to produce different characters (as well as changing the display of any previously-entered text in the same manner). A common choice in locales using variants of the Latin alphabet was CP850, which provided more Latin character variants. (There were, however, many more code pages).

PC keyboards designed for non-English use included other methods of inserting these characters, such as national keyboard layouts, the AltGr key or dead keys, but the Alt key was the only method of inserting some characters, and the only method that was the same on all machines, so it remained very popular. This input method is emulated by many pieces of software (such as later versions of MS-DOS and Windows) that do not use the BIOS keyboard decoding.

In the ASCII standard, the numbers 0-31 and 127 are assigned to control characters, for instance, code point 7 is typed by . While some (most?) applications would insert a bullet character (code point 7 on code page 437), some would treat this identical to which often was a command for the program.

Windows

The Alt codes had become so well known and memorized by users that Microsoft decided to preserve them in Microsoft Windows, even though the OS features a newer and different set of code pages such as CP1252. Windows includes the following processing algorithm for Alt code, which supports both methods:

  • The familiar + combination retains the old MS-DOS behavior, i.e., generates characters from the legacy code pages now called "OEM code pages". For instance + produces . code point 163 in CP437 or CP850. The "OEM code page" selection served little or no other purpose other than to control what Alt codes produced, if other code pages were selected then these numbers could produce different characters, but it did not change the display. It was impossible to type characters that were not in the Windows code page, such as box-drawing symbols.

  • The new + combination (which prefixes a zero to each Alt code), produces characters from the newer "ANSI code pages". For instance + results in (when CP1252 is active, because it occupies position 163 in that code page). The active Windows code page could be different, which could change the effect of these Alt codes.

Unicode

Later versions of Windows and applications such as Microsoft Word supported Unicode. As Unicode included all the characters in all the MSDOS code pages, this had the immediate benefit that all the old MSDOS Alt combinations worked, not just the ones that existed in the Windows Code Page. And far more software stopped changing how documents displayed or printed when the selected code page was changed.

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 (in particular applications using the Windows RichEdit control, such as WordPad and PSPad) made numbers from 256 to 65,535 produce the corresponding Unicode character. For instance, + in WordPad produces the . If the Windows Code Page was set to CP1252 then all Unicode BMP characters except control characters could be typed this way.

Hex Alt Codes

Because most Unicode documentation and character tables show the code points in hex, not decimal, a variation of Alt codes was developed to allow the typing of numbers in hex (using the main keyboard for –). To enable it, a user must set or create a string type () value called EnableHexNumpad in the registry key HKEY_CURRENT_USER\Control Panel\Input Method, assign the value data 1 to it, and then reboot or log out/in. A leading then indicates hex input, for example will produce (e with caron).

There are many other ways of typing arbitrary Unicode characters, such as the Character Map utility.

Other operating systems

The Alt key method does not work on ChromeOS, macOS, Linux or other operating systems and there is no evidence of interest in replicating it. However, numeric entry of Unicode characters is possible in most Unix or Unix-like OSs by pressing and releasing , and typing the hex number followed by the space bar or enter key. For example,

  • For the registered trademark symbol , type , , .
  • For the no entry sign , type , , .

Limitations

If is disabled, attempting an Alt code may cause unexpected results in some applications, due to the controls used on the same key. For example, can be taken as , causing a web browser to go back one page.

List of codes

UnicodeCP437CP850CP1252Unicode name¡¢£¤¥¦§¨©ª«¬­®¯°±23´μ·¸1º»¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿıŒœŠšŸŽžƒˆ˜ΓΘΣΦΩαδεπστφ...n
U+00A02550160NO-BREAK SPACE
U+00A11730161INVERTED EXCLAMATION MARK
U+00A21551890162CENT SIGN
U+00A31560163POUND SIGN
U+00A42070164CURRENCY SIGN
U+00A51571900165YEN SIGN
U+00A62210166BROKEN BAR
U+00A7212450167SECTION SIGN
U+00A82490168DIAERESIS
U+00A91840169COPYRIGHT SIGN
U+00AA1660170FEMININE ORDINAL INDICATOR
U+00AB1740171LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
U+00AC1700172NOT SIGN
U+00AD2400173SOFT HYPHEN
U+00AE1690174REGISTERED SIGN
U+00AF2380175MACRON
U+00B02480176DEGREE SIGN
U+00B12410177PLUS-MINUS SIGN
U+00B22530178SUPERSCRIPT TWO
U+00B32520179SUPERSCRIPT THREE
U+00B42390180ACUTE ACCENT
U+00B52300181MICRO SIGN
U+00B6202440182PILCROW SIGN
U+00B72500183MIDDLE DOT
U+00B82470184CEDILLA
U+00B92510185SUPERSCRIPT ONE
U+00BA1670186MASCULINE ORDINAL INDICATOR
U+00BB1750187RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
U+00BC1720188VULGAR FRACTION ONE QUARTER
U+00BD1710189VULGAR FRACTION ONE HALF
U+00BE2430190VULGAR FRACTION THREE QUARTERS
U+00BF1680191INVERTED QUESTION MARK
U+00C01830192LATIN CAPITAL LETTER A WITH GRAVE
U+00C11810193LATIN CAPITAL LETTER A WITH ACUTE
U+00C21820194LATIN CAPITAL LETTER A WITH CIRCUMFLEX
U+00C31990195LATIN CAPITAL LETTER A WITH TILDE
U+00C41420196LATIN CAPITAL LETTER A WITH DIAERESIS
U+00C51430197LATIN CAPITAL LETTER A WITH RING ABOVE
U+00C61460198LATIN CAPITAL LETTER AE
U+00C71280199LATIN CAPITAL LETTER C WITH CEDILLA
U+00C82120200LATIN CAPITAL LETTER E WITH GRAVE
U+00C91440201LATIN CAPITAL LETTER E WITH ACUTE
U+00CA2100202LATIN CAPITAL LETTER E WITH CIRCUMFLEX
U+00CB2110203LATIN CAPITAL LETTER E WITH DIAERESIS
U+00CC2220204LATIN CAPITAL LETTER I WITH GRAVE
U+00CD2140205LATIN CAPITAL LETTER I WITH ACUTE
U+00CE2150206LATIN CAPITAL LETTER I WITH CIRCUMFLEX
U+00CF2160207LATIN CAPITAL LETTER I WITH DIAERESIS
U+00D02090208LATIN CAPITAL LETTER ETH
U+00D11650209LATIN CAPITAL LETTER N WITH TILDE
U+00D22270210LATIN CAPITAL LETTER O WITH GRAVE
U+00D32240211LATIN CAPITAL LETTER O WITH ACUTE
U+00D42260212LATIN CAPITAL LETTER O WITH CIRCUMFLEX
U+00D52290213LATIN CAPITAL LETTER O WITH TILDE
U+00D61530214LATIN CAPITAL LETTER O WITH DIAERESIS
U+00D71580215MULTIPLICATION SIGN
U+00D81570216LATIN CAPITAL LETTER O WITH STROKE
U+00D92350217LATIN CAPITAL LETTER U WITH GRAVE
U+00DA2330218LATIN CAPITAL LETTER U WITH ACUTE
U+00DB2340219LATIN CAPITAL LETTER U WITH CIRCUMFLEX
U+00DC1540220LATIN CAPITAL LETTER U WITH DIAERESIS
U+00DD2370221LATIN CAPITAL LETTER Y WITH ACUTE
U+00DE2320222LATIN CAPITAL LETTER THORN
U+00DF2250223LATIN SMALL LETTER SHARP S
U+00E01330224LATIN SMALL LETTER A WITH GRAVE
U+00E11600225LATIN SMALL LETTER A WITH ACUTE
U+00E21310226LATIN SMALL LETTER A WITH CIRCUMFLEX
U+00E31980227LATIN SMALL LETTER A WITH TILDE
U+00E41320228LATIN SMALL LETTER A WITH DIAERESIS
U+00E51340229LATIN SMALL LETTER A WITH RING ABOVE
U+00E61450230LATIN SMALL LETTER AE
U+00E71350231LATIN SMALL LETTER C WITH CEDILLA
U+00E81380232LATIN SMALL LETTER E WITH GRAVE
U+00E91300233LATIN SMALL LETTER E WITH ACUTE
U+00EA1360234LATIN SMALL LETTER E WITH CIRCUMFLEX
U+00EB1370235LATIN SMALL LETTER E WITH DIAERESIS
U+00EC1410236LATIN SMALL LETTER I WITH GRAVE
U+00ED1610237LATIN SMALL LETTER I WITH ACUTE
U+00EE1400238LATIN SMALL LETTER I WITH CIRCUMFLEX
U+00EF1390239LATIN SMALL LETTER I WITH DIAERESIS
U+00F02080240LATIN SMALL LETTER ETH
U+00F11640241LATIN SMALL LETTER N WITH TILDE
U+00F21490242LATIN SMALL LETTER O WITH GRAVE
U+00F31620243LATIN SMALL LETTER O WITH ACUTE
U+00F41470244LATIN SMALL LETTER O WITH CIRCUMFLEX
U+00F52280245LATIN SMALL LETTER O WITH TILDE
U+00F61480246LATIN SMALL LETTER O WITH DIAERESIS
U+00F72460247DIVISION SIGN
U+00F81550248LATIN SMALL LETTER O WITH STROKE
U+00F91510249LATIN SMALL LETTER U WITH GRAVE
U+00FA1630250LATIN SMALL LETTER U WITH ACUTE
U+00FB1500251LATIN SMALL LETTER U WITH CIRCUMFLEX
U+00FC1290252LATIN SMALL LETTER U WITH DIAERESIS
U+00FD2360253LATIN SMALL LETTER Y WITH ACUTE
U+00FE2310254LATIN SMALL LETTER THORN
U+00FF1520255LATIN SMALL LETTER Y WITH DIAERESIS
U+0131213LATIN SMALL LETTER DOTLESS I
U+0152}}0140LATIN CAPITAL LIGATURE OE
U+0153}}0156LATIN SMALL LIGATURE OE
U+0160}}0138LATIN CAPITAL LETTER S WITH CARON
U+0161}}0154LATIN SMALL LETTER S WITH CARON
U+0178}}0159LATIN CAPITAL LETTER Y WITH DIAERESIS
U+017D}}0142LATIN CAPITAL LETTER Z WITH CARON
U+017E}}0158LATIN SMALL LETTER Z WITH CARON
U+01921590131LATIN SMALL LETTER F WITH HOOK
U+02C6}}0136MODIFIER LETTER CIRCUMFLEX ACCENT
U+02DC}}0152SMALL TILDE
U+0393226}}GREEK CAPITAL LETTER GAMMA
U+0398233}}GREEK CAPITAL LETTER THETA
U+03A3228}}GREEK CAPITAL LETTER SIGMA
U+03A6232}}GREEK CAPITAL LETTER PHI
U+03A9234}}GREEK CAPITAL LETTER OMEGA
U+03B1224}}GREEK SMALL LETTER ALPHA
U+03B4235}}GREEK SMALL LETTER DELTA
U+03B5238}}GREEK SMALL LETTER EPSILON
U+03C0227}}GREEK SMALL LETTER PI
U+03C3229}}GREEK SMALL LETTER SIGMA
U+03C4231}}GREEK SMALL LETTER TAU
U+03C6237}}GREEK SMALL LETTER PHI
U+2013}}0150EN DASH
U+2014}}0151EM DASH
U+2017242DOUBLE LOW LINE
U+2018}}0145LEFT SINGLE QUOTATION MARK
U+2019}}0146RIGHT SINGLE QUOTATION MARK
U+201A}}0130SINGLE LOW-9 QUOTATION MARK
U+201C}}0147LEFT DOUBLE QUOTATION MARK
U+201D}}0148RIGHT DOUBLE QUOTATION MARK
U+201E}}0132DOUBLE LOW-9 QUOTATION MARK
U+2020}}0134DAGGER
U+2021}}0135DOUBLE DAGGER
U+202270149BULLET
U+2026}}0133HORIZONTAL ELLIPSIS
U+2030}}0137PER MILLE SIGN
U+2039}}0139SINGLE LEFT-POINTING ANGLE QUOTATION MARK
U+203A}}0155SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
U+203C19DOUBLE EXCLAMATION MARK
U+207F252}}SUPERSCRIPT LATIN SMALL LETTER N
U+20A7158}}PESETA SIGN
U+20AC}}0128EURO SIGN
U+2122}}0153TRADE MARK SIGN
U+219027LEFTWARDS ARROW
U+219124UPWARDS ARROW
U+219226RIGHTWARDS ARROW
U+219325DOWNWARDS ARROW
U+219429LEFT RIGHT ARROW
U+219518UP DOWN ARROW
U+21A823UP DOWN ARROW WITH BASE
U+2219249}}BULLET OPERATOR
U+221A251}}SQUARE ROOT
U+221E236}}INFINITY
U+221F28RIGHT ANGLE
U+2229239}}INTERSECTION
U+2248247}}ALMOST EQUAL TO
U+2264243}}LESS-THAN OR EQUAL TO
U+2261240}}IDENTICAL TO
U+2265242}}GREATER-THAN OR EQUAL TO
U+2302127HOUSE
U+2310169}}REVERSED NOT SIGN
U+2320244}}TOP HALF INTEGRAL
U+2321245}}BOTTOM HALF INTEGRAL
U+2500196BOX DRAWINGS LIGHT HORIZONTAL
U+2502179BOX DRAWINGS LIGHT VERTICAL
U+250C218BOX DRAWINGS LIGHT DOWN AND RIGHT
U+2510191BOX DRAWINGS LIGHT DOWN AND LEFT
U+2514192BOX DRAWINGS LIGHT UP AND RIGHT
U+2518217BOX DRAWINGS LIGHT UP AND LEFT
U+251C195BOX DRAWINGS LIGHT VERTICAL AND RIGHT
U+2524180BOX DRAWINGS LIGHT VERTICAL AND LEFT
U+252C194BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
U+2534193BOX DRAWINGS LIGHT UP AND HORIZONTAL
U+253C197BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
U+2550205BOX DRAWINGS DOUBLE HORIZONTAL
U+2551186BOX DRAWINGS DOUBLE VERTICAL
U+2552213}}BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE
U+2553214}}BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE
U+2554201BOX DRAWINGS DOUBLE DOWN AND RIGHT
U+2555184}}BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE
U+2556183}}BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE
U+2557187BOX DRAWINGS DOUBLE DOWN AND LEFT
U+2558212}}BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE
U+2559211}}BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE
U+255A200BOX DRAWINGS DOUBLE UP AND RIGHT
U+255B190}}BOX DRAWINGS UP SINGLE AND LEFT DOUBLE
U+255C189}}BOX DRAWINGS UP DOUBLE AND LEFT SINGLE
U+255D188BOX DRAWINGS DOUBLE UP AND LEFT
U+255E198}}BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE
U+255F199}}BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE
U+2560204BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
U+2562182}}BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE
U+2563185BOX DRAWINGS DOUBLE VERTICAL AND LEFT
U+2564209}}BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE
U+2565210}}BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE
U+2566203BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
U+2567207}}BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE
U+2568208}}BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE
U+2569202BOX DRAWINGS DOUBLE UP AND HORIZONTAL
U+256A216}}BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE
U+256B215}}BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE
U+256C206BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
U+2580223UPPER HALF BLOCK
U+2584220LOWER HALF BLOCK
U+2588219FULL BLOCK
U+258C221}}LEFT HALF BLOCK
U+2590222}}RIGHT HALF BLOCK
U+2591176LIGHT SHADE
U+2592177MEDIUM SHADE
U+2593178DARK SHADE
U+25A0254BLACK SQUARE
U+25AC22BLACK RECTANGLE
U+25B230BLACK UP-POINTING TRIANGLE
U+25BA16BLACK RIGHT-POINTING POINTER
U+25BC31BLACK DOWN-POINTING TRIANGLE
U+25C417BLACK LEFT-POINTING POINTER
U+25CB9WHITE CIRCLE
U+25D88INVERSE BULLET
U+25D910INVERSE WHITE CIRCLE
U+263A1WHITE SMILING FACE
U+263B2BLACK SMILING FACE
U+263C15WHITE SUN WITH RAYS
U+264012FEMALE SIGN
U+264211MALE SIGN
U+26606BLACK SPADE SUIT
U+26635BLACK CLUB SUIT
U+26653BLACK HEART SUIT
U+26664BLACK DIAMOND SUIT
U+266A13EIGHTH NOTE
U+266B14BEAMED EIGHTH NOTES

Notes

References

de:Alt (Taste)#Alt-Code

References

  1. "Alt Codes List of Alt Key Codes Symbols".
  2. If the entered value exceeds 255, only the remainder after dividing by 256 (i.e., the value [[modulo]] 256) was used by the BIOS. For example, 520 is interpreted as 520 mod 256 = 8, so it produces the same character as for value 8.
  3. (2016-07-22). "To input characters that are not on your keyboard".
  4. Chen, Raymond. (2 July 2024). "The history of Alt+number sequences, and why Alt+9731 sometimes gives you a heart and sometimes a snowman". Microsoft.
  5. Walker, Jim. (27 April 2022). "About Rich Edit Controls". Microsoft.
Info: Wikipedia Source

This article was imported from Wikipedia and is available under the Creative Commons Attribution-ShareAlike 4.0 License. Content has been adapted to SurfDoc format. Original contributors can be found on the article history page.

Want to explore this topic further?

Ask Mako anything about Alt code — get instant answers, deeper analysis, and related topics.

Research with Mako

Free with your Surf account

Content sourced from Wikipedia, available under CC BY-SA 4.0.

This content may have been generated or modified by AI. CloudSurf Software LLC is not responsible for the accuracy, completeness, or reliability of AI-generated content. Always verify important information from primary sources.

Report