ASCII Table

Dec Hex Oct Char Extra Literal
0 00 000 NUL null '\x00'
1 01 001 SOH start of heading '\x01'
2 02 002 STX start of text '\x02'
3 03 003 ETX end of text '\x03'
4 04 004 EOT end of transmission '\x04'
5 05 005 ENQ enquiry '\x05'
6 06 006 ACK acknowledge '\x06'
7 07 007 BEL bell '\a'
8 08 010 BS backspace '\b'
9 09 011 TAB horizontal tab '\t'
10 0a 012 LF new line '\n'
11 0b 013 VT vertical tab '\v'
12 0c 014 FF form feed '\f'
13 0d 015 CR carriage return '\r'
14 0e 016 SO shift out '\x0e'
15 0f 017 SI shift in '\x0f'
Dec Hex Oct Char Extra Literal
16 10 020 DLE data link escape '\x10'
17 11 021 DC1 device control 1 '\x11'
18 12 022 DC2 device control 2 '\x12'
19 13 023 DC3 device control 3 '\x13'
20 14 024 DC3 device control 4 '\x14'
21 15 025 NAK negative acknowledge '\x15'
22 16 026 SYN synchronous idle '\x16'
23 17 027 ETB end of trans. block '\x17'
24 18 030 CAN cancel '\x18'
25 19 031 EM end of medium '\x19'
26 1a 032 SUB substitute '\x1a'
27 1b 033 ESC escape '\e'*
28 1c 034 FS file separator '\x1c'
29 1d 035 GS group separator '\x1d'
30 1e 036 RS record separator '\x1e'
31 1f 037 US unit separator '\x1f'
Dec Hex Oct Char
32 20 040 Space
33 21 041 !
34 22 042 "
35 23 043 #
36 24 044 $
37 25 045 %
38 26 046 &
39 27 047 '
40 28 050 (
41 29 051 )
42 2a 052 *
43 2b 053 +
44 2c 054 ,
45 2d 055
46 2e 056 .
47 2f 057 /
Dec Hex Oct Char
48 30 060 0
49 31 061 1
50 32 062 2
51 33 063 3
52 34 064 4
53 35 065 5
54 36 066 6
55 37 067 7
56 38 070 8
57 39 071 9
58 3a 072 :
59 3b 073 ;
60 3c 074 <
61 3d 075 =
62 3e 076 >
63 3f 077 ?
Dec Hex Oct Char
64 40 100 @
65 41 101 A
66 42 102 B
67 43 103 C
68 44 104 D
69 45 105 E
70 46 106 F
71 47 107 G
72 48 110 H
73 49 111 I
74 4a 112 J
75 4b 113 K
76 4c 114 L
77 4d 115 M
78 4e 116 N
79 4f 117 O
Dec Hex Oct Char
80 50 120 P
81 51 121 Q
82 52 122 R
83 53 123 S
84 54 124 T
85 55 125 U
86 56 126 V
87 57 127 W
88 58 130 X
89 59 131 Y
90 5a 132 Z
91 5b 133 [
92 5c 134 \
93 5d 135 ]
94 5e 136 ^
95 5f 137 _
Dec Hex Oct Char
96 60 140 `
97 61 141 a
98 62 142 b
99 63 143 c
100 64 144 d
101 65 145 e
102 66 146 f
103 67 147 g
104 68 150 h
105 69 151 i
106 6a 152 j
107 6b 153 k
108 6c 154 l
109 6d 155 m
110 6e 156 n
111 6f 157 o
Dec Hex Oct Char
112 70 160 p
113 71 161 q
114 72 162 r
115 73 163 s
116 74 164 t
117 75 165 u
118 76 166 v
119 77 167 w
120 78 170 x
121 79 171 y
122 7a 172 z
123 7b 173 {
124 7c 174 |
125 7d 175 }
126 7e 176 ˜
127 7f 177 DEL

*'\e' is a GCC extension, not all languages support it.


ASCII (or US-ASCII if you're from the IANA) is the way that computers represent text. It was first published as a standard in 1963. Originally it did not include any lower case characters, but after revisions it more closely resembles what we use today.

UTF-8, which is now preferred in most applications to ASCII, bases the lower portion of its character set on ASCII so as to be compatible with it.

At first the numbers characters start at may seem random, but they are definitely not.

Firstly the numbers are all in order. This means that you can just subtract 0x30 from any ASCII number character and be left with the pure numeric value. But it goes further than that. The numbers start at 0x30, and that's for a reason, being on an even boundary like that a bitwise and can be used to remove the upper bits, leaving just the number, much quicker in some systems than a subtraction could have.

The distance between the characters 'A' and 'a' is also nice and even, 32. That means that you can flip a single bit (the 6th bit, 0x20) to change a lowercase character to uppercase, or vice-versa.