ASCII code table (for reference)

Source: Internet
Author: User
Tags control characters

ASCII, American Standard Code for Information Interchange reads like "astkey" and defines the English letters or the same result and meaning represented by the 127 numbers ranging from 0 to one hundred and twenty-eight. Because only seven digits (bit) can be used to represent numbers from 0 to 127, most computers use eight digits to access the character set (character set ), therefore, numbers between 128 and 255 can be used to represent another group of one hundred and twenty-eight symbols, which are called extended ASCII.
ASCII code Keyboard ASCII code Keyboard ASCII code Keyboard ASCII code Keyboard
27 ESC 32 SPACE 33 ! 34 "
35 # 36 $ 37 % 38 &
39 ' 40 ( 41 ) 42 *
43 + 44 ' 45 - 46 .
47 / 48 0 49 1 50 2
51 3 52 4 53 5 54 6
55 7 56 8 57 9 58 :
59 ; 60 < 61 = 62 >
63 ? 64 @ 65 A 66 B
67 C 68 D 69 E 70 F
71 G 72 H 73 I 74 J
75 K 76 L 77 M 78 N
79 O 80 P 81 Q 82 R
83 S 84 T 85 U 86 V
87 W 88 X 89 Y 90 Z
91 [ 92 \ 93 ] 94 ^
95 _ 96 ` 97 A 98 B
99 C 100 D 101 E 102 F
103 G 104 H 105 I 106 J
107 K 108 L 109 M 110 N
111 O 112 P 113 Q 114 R
115 S 116 T 117 U 118 V
119 W 120 X 121 Y 122 Z
123 { 124 | 125 } 126 ~

Currently, the most widely used character set and Its Encoding in computers are American Standard Code for Information Interchange (American Standard Code for Information Interchange) developed by the National Bureau of Standards (ANSI ), it has been set as an international standard by the International Organization for Standardization (ISO), known as the ISO 646 standard. It is applicable to all Latin characters, including 7-digit ASCII code and 8-digit ASCII code.

Because the number of one-bit binary data can be expressed as (21 =) two states: 0 and 1, while the number of two-bit binary data can be expressed as (22) = four states: 00, 01, 10, 11, and so on. A 7-bit binary number can represent (27 =) 128 States. Each State is uniquely encoded as a 7-bit binary code, corresponds to one character (or control code), which can be arranged into a decimal number ranging from 0 ~ 127. Therefore, the 7-bit ASCII code is encoded using the seven-bit binary number, which can represent 128 characters.

0th ~ 32 and 127th (34 in total) are control characters or communication special characters, such as control characters: LF (line feed), CR (Press ENTER), FF (page feed), DEL (delete), BEL (zhenling); Communication special characters: SOH (Text header), EOT (Text tail), ACK (confirmation), etc;

33rd ~ 126 (94 in total) is a character, of which 48th ~ Number 57 is 0 ~ 9. 10 Arabic numerals; 65 ~ The 90 is 26 uppercase English letters, 97 ~ There are 26 lower-case English letters, and the remaining are some punctuation marks and operator numbers.

Note: In a computer's storage unit, an ASCII code value occupies one byte (eight binary digits), and its highest bit (b7) is used as the parity bit. The so-called parity check refers to a method used to check whether an error occurs during code transfer. It is generally divided into two types: Odd checksum and even verification. Odd check rules: correct code must contain an odd number of 1 bytes. If the number is not an odd number, 1 is added to the highest bit b7. Even check rules: correct code: the number of 1 in a byte must be an even number. If the number is not an even number, 1 is added to the highest bit of b7.

Appendix:

ASCII table

 

ASCII Value Control characters ASCII Value Control characters ASCII Value Control characters ASCII Value Control characters
0 NUT 32 (Space) 64 @ 96 ,
1 SOH 33 ! 65 A 97 A
2 STX 34 " 66 B 98 B
3 ETX 35 # 67 C 99 C
4 EOT 36 $ 68 D 100 D
5 ENQ 37 % 69 E 101 E
6 ACK 38 & 70 F 102 F
7 BEL 39 , 71 G 103 G
8 BS 40 ( 72 H 104 H
9 HT 41 ) 73 I 105 I
10 LF 42 * 74 J 106 J
11 VT 43 + 75 K 107 K
12 FF 44 , 76 L 108 L
13 CR 45 - 77 M 109 M
14 SO 46 . 78 N 110 N
15 SI 47 / 79 O 111 O
16 DLE 48 0 80 P 112 P
17 DCI 49 1 81 Q 113 Q
18 DC2 50 2 82 R 114 R
19 DC3 51 3 83 X 115 S
20 DC4 52 4 84 T 116 T
21 NAK 53 5 85 U 117 U
22 SYN 54 6 86 V 118 V
23 TB 55 7 87 W 119 W
24 CAN 56 8 88 X 120 X
25 EM 57 9 89 Y 121 Y
26 SUB 58 : 90 Z 122 Z
27 ESC 59 ; 91 [ 123 {
28 FS 60 < 92 \ 124 |
29 GS 61 = 93 ] 125 }
30 RS 62 > 94 ^ 126 ~
31 US 63 ? 95 - 127 DEL
 

 

NUL VT vertical tabulation SYN idling Synchronization
SOH title starts FF Paper Control ETB Information Group Transfer ended
Start of STX text CR press ENTER CAN void
ETX text ended SO shift output EM paper
EOY transmission ends SI shift Input SUB placement
ENQ query characters DLE Space ESC code change
ACK acknowledge DC1 Device Control 1 FS text Separator
BEL alarm DC2 Device Control 2 GS group Separator
BS returns to one grid DC3 Device Control 3 RS record delimiter
HT horizontal list DC4 Device Control 4 US unit Separator
LF line feed NAK no DEL Delete
 

 

Common ASCII codes for keyboards
ESC key VK_ESCAPE (27)
Enter the key: VK_RETURN (13)
TAB key: VK_TAB (9)
Caps Lock key: VK_CAPITAL (20)
Shift key: VK_SHIFT ($10)
Ctrl: VK_CONTROL (17)
Alt key: VK_MENU (18)
Space key: VK_SPACE ($20/32)
Backspace key: VK_BACK (8)
Left logo key: VK_LWIN (91)
Right logo key: VK_LWIN (92)
Right-click the shortcut key: VK_APPS (93)

Insert key: VK_INSERT (45)
Home Key: VK_HOME (36)
Page Up: VK_PRIOR (33)
PageDown: VK_NEXT (34)
End key: VK_END (35)
Delete key: VK_DELETE (46)

Direction key (Direction): VK_LEFT (37)
Direction key (Direction): VK_UP (38)
Direction key (→): VK_RIGHT (39)
Direction key (Direction): VK_DOWN (40)

F1 key: VK_F1 (112)
F2 key: VK_F2 (113)
F3 key: VK_F3 (114)
F4 key: VK_F4 (115)
F5 key: VK_F5 (116)
F6 key: VK_F6 (117)
F7 key: VK_F7 (118)
F8: VK_F8 (119)
F9 key: VK_F9 (120)
F10 key: VK_F10 (121)
F11 key: VK_F11 (122)
F12 key: VK_F12 (123)

Num Lock key: VK_NUMLOCK (144)
Keypad 0: VK_NUMPAD0 (96)
Keypad 1: VK_NUMPAD0 (97)
Keypad 2: VK_NUMPAD0 (98)
Keypad 3: VK_NUMPAD0 (99)
Keypad 4: VK_NUMPAD0 (100)
Keypad 5: VK_NUMPAD0 (101)
Keypad 6: VK_NUMPAD0 (102)
Keypad 7: VK_NUMPAD0 (103)
Keypad 8: VK_NUMPAD0 (104)
Keypad 9: VK_NUMPAD0 (105)
Keypad.: VK_DECIMAL (110)
Keypad *: VK_MULTIPLY (106)
Keypad +: VK_MULTIPLY (107)
Keypad-: VK_SUBTRACT (109)
Keypad/: VK_DIVIDE (111)

Pause Break Key: VK_PAUSE (19)
Scroll Lock key: VK_SCROLL (145)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.