Appendix C
The ASCII character set
The American Standard Code for Information Interchange (ASCII) was invented in 1963, and after some redevelopment settled down in 1984 as standard X3.4 of American National Standards Institute (ANSI). It represents the 95 basic codes for the unaccented printable characters and punctuation of the Latin alphabet, plus 33 internal ‘control characters’ originally intended for the control of computers, programs, and external devices like printers and screens.
Many other character sets (strictly speaking, ‘character repertoires’) have been standardised for accented Latin characters and for all other non-Latin writing systems, but these are intended for representing the symbols people use when writing text on computers. Most programs and computers use ASCII internally for all their coding, the exceptions being XML-based languages like XSLT, which are inherently designed to be usable with any writing system, and a few specialist systems like APL.
Although the TEX and LATEX file formats can easily be used with many other encoding systems (see the discussion of the inputenc in section 2.6), they are based on ASCII. It is therefore important to know where to find all 95 of the printable characters, as some of them are not often used in other text-formatting systems. The following table shows all 128 characters, with their decimal, octal (base-8), and hexadecimal (base-16) code numbers.
| Oct | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | Hex |
|---|---|---|---|---|---|---|---|---|---|
| ′00↑ | NUL 0 |
SOH 1 |
STX 2 |
ETX 3 |
EOT 4 |
ENQ 5 |
ACK 6 |
BEL 7 |
''0↑ |
| '01↑ | BS 8 |
HT 9 |
LF 10 |
VT 11 |
FF 12 |
CR 13 |
SO 14 |
SI 15 |
''0↓ |
| '02↑ | DLE 16 |
DC1 17 |
DC2 18 |
DC3 19 |
DC4 20 |
NAK 21 |
SYN 22 |
ETB 23 |
''1↑ |
| '03↑ | CAN 24 |
EM 25 |
SUB 26 |
ESC 27 |
FS 28 |
GS 29 |
RS 30 |
US 31 |
''1↓ |
| '04↑ | 32 |
! 33 |
" 34 |
# 35 |
$ 36 |
% 37 |
& 38 |
' 39 |
''2↑ |
| '05↑ | ( 40 |
) 41 |
* 42 |
+ 43 |
, 44 |
- 45 |
. 46 |
/ 47 |
''2↓ |
| '06↑ | 0 48 |
1 49 |
2 50 |
3 51 |
4 52 |
5 53 |
6 54 |
7 55 |
''3↑ |
| '07↑ | 8 56 |
9 57 |
: 58 |
; 59 |
< < 60 |
= 61 |
> > 62 |
? 63 |
''3↓ |
| '10↑ | @ 64 |
A 65 |
B 66 |
C 67 |
D 68 |
E 69 |
F 70 |
G 71 |
''4↑ |
| '11↑ | H 72 |
I 73 |
J 74 |
K 75 |
L 76 |
M 77 |
N 78 |
O 79 |
''4↓ |
| '12↑ | P 80 |
Q 81 |
R 82 |
S 83 |
T 84 |
U 85 |
V 86 |
W 87 |
''5↑ |
| '13↑ | X 88 |
Y 89 |
Z 90 |
[ 91 |
\textbackslash \ 92 |
] 93 |
\char'136 ^ 94 |
\_ _ 95 |
''5↓ |
| '14↑ | ` 96 |
a 97 |
b 98 |
c 99 |
d 100 |
e 101 |
f 102 |
g 103 |
''6↑ |
| '15↑ | h 104 |
i 105 |
j 106 |
k 107 |
l 108 |
m 109 |
n 110 |
o 111 |
''6↓ |
| '16↑ | p 112 |
q 113 |
r 114 |
s 115 |
t 116 |
u 117 |
v 118 |
w 119 |
''7↑ |
| '17↑ | x 120 |
y 121 |
z 122 |
{ 123 |
\textbrokenbar | 124 |
} 125 |
˜ 126 |
DEL 127 |
''7↓ |
| 8 | 9 | A | B | C | D | E | F |
Decimal number values are under each character. The index numbers in the first and last columns are for finding the octal (base-8) and hexadecimal (base-16) values respectively. Replace the arrow with the number or letter from the top of the column (if the arrow points up) or from the bottom of the column(if the arrow points down).
Example: The Escape character (ESC) is octal '033 (03 for the row, 3 for the number at the top of the column because the arrow points up) or hexadecimal "1B (1 for the row, B for the letter at the bottom of the column because the arrow points down).



