Standard ASCII codes

Including BS4730 and Obsolete ASCII versions

Explanatory text follows the first table.

Decimal ASCII Table

__0 __1 __2 __3 __4 __5 __6 __7 __8 __9
_
^@
^A
^B
^C
^D
^E
^F
^G
^H
^I
1_
^J
^K
^L
^M
^N
^O
^P
^Q
^R
^S
2_
^T
^U
^V
^W
^X
^Y
^Z
^[
^\
^]
3_
^^
^_
 
!
"
#
$
%
&
'
4_
(
)
*
+
,
-
.
/
0
1
5_
2
3
4
5
6
7
8
9
:
;
6_
<
=
>
?
@
A
B
C
D
E
7_
F
G
H
I
J
K
L
M
N
O
8_
P
Q
R
S
T
U
V
W
X
Y
9_
Z
[
\
]
^
_
`
a
b
c
10_
d
e
f
g
h
i
j
k
l
m
11_
n
o
p
q
r
s
t
u
v
w
12_
x
y
z
{
|
}
~



ASCII is a seven bit code, it only defines codes from 0 to 127. Codes outside this range are not part of ASCII, and vary in meaning considerably. The version in use today is more completely called ASCII-1967 (it was adopted in 1967), and there are two slightly different earlier versions documented below.

ASCII uses only seven bits. Although it was communicated in eight-bit bytes, normal communication channels were unreliable. The 8th bit was used for error checking (parity). Typically the 8th bit was set to ensure that there was always an odd number of 1's in each byte transmitted (e.g. '$' is binary 0100100 which has an even number on 1's so is transmitted as 10100100; 'F' is binary 1000110 with an odd number of 1's so is transmitted as 01000110), but even parity systems were also used. The receiving equipment would simply check the parity of each byte; any single-bit inversion would be detected, and large errors were very likely to be noticed.

Seven bit code was not considered strange; it is only comparatively recently that computers with eight-bit byte based memory became an accidental standard. The Dec-system-10 had 36-bit memory, then ICL-1900 had 24-bit memory, and the CDC-6600 had 60-bit memory, to name but three.

Alternative character codes are:

for meanings of control characters (codes 0-31), see below.

In these tables, a two character sequence beginning with ^ represents a control character; e.g. ^X means control-X.


Hexadecimal ASCII Table

__0 __1 __2 __3 __4 __5 __6 __7 __8 __9 __A __B __C __D __E __F
0__
^@
^A
^B
^C
^D
^E
^F
^G
^H
^I
^J
^K
^L
^M
^N
^O
1__
^P
^Q
^R
^S
^T
^U
^V
^W
^X
^Y
^Z
^[
^\
^]
^^
^_
2__
 
!
"
#
$
%
&
'
(
)
*
+
,
-
.
/
3__
0
1
2
3
4
5
6
7
8
9
:
;
<
=
>
?
4__
@
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
5__
P
Q
R
S
T
U
V
W
X
Y
Z
[
\
]
^
_
6__
`
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
7__
p
q
r
s
t
u
v
w
x
y
z
{
|
}
~



Octal ASCII Table

__0 __1 __2 __3 __4 __5 __6 __7
00_
^@
^A
^B
^C
^D
^E
^F
^G
01_
^H
^I
^J
^K
^L
^M
^N
^O
02_
^P
^Q
^R
^S
^T
^U
^V
^W
03_
^X
^Y
^Z
^[
^\
^]
^^
^_
04_
 
!
"
#
$
%
&
'
05_
(
)
*
+
,
-
.
/
06_
0
1
2
3
4
5
6
7
07_
8
9
:
;
<
=
>
?
10_
@
A
B
C
D
E
F
G
11_
H
I
J
K
L
M
N
O
12_
P
Q
R
S
T
U
V
W
13_
X
Y
Z
[
\
]
^
_
14_
`
a
b
c
d
e
f
g
15_
h
i
j
k
l
m
n
o
16_
p
q
r
s
t
u
v
w
17_
x
y
z
{
|
}
~


Invisible (or Non-Printing) Characters

Dec
Hex
Oct
char
name
meaning
0
00
000
^@
NUL
Null character
(C: end of string)
1
01
001
^A
SOH
Start of Heading
(Alt: wake up!)
(Alt: beginning of line)
2
02
002
^B
STX
Start of Text
(VMS: toggle insert/overstrike)
3
03
003
^C
ETX
End of Text
(Most systems: user interrupt)
4
04
004
^D
EOT
End of Transmission
(Unix C and tcsh shells: end of file)
5
05
005
^E
ENQ
Enquiry
(Alt: end of line)
6
06
006
^F
ACK
Acknowledgement
7
07
007
^G
BEL
Audible Bell or Alarm
8
08
010
^H
BS
Backspace
(Old Cursor Control: move left)
9
09
011
^I
HT
Horizontal Tab
10
0A
012
^J
LF
Line Feed
(Old Cursor Control: move down)
(Unix: end of line)
11
0B
013
^K
VT
Vertical Tab
(Old Cursor Control: move up)
12
0C
014
^L
FF
Form Feed
(Old Cursor Control: move right)
13
0D
015
^M
CR
Carriage Return
(Non-Unix: end of line = CR+LF)
14
0E
016
^N
SO
Shift Out
15
0F
017
^O
SI
Shift In
(Some systems: toggle display/discard terminal output)
16
10
020
^P
DLE
Data Link Escape
17
11
021
^Q
XON or DC1
Device Control 1: Resume Transmission
18
12
022
^R
DC2
Device Control 2
(VMS: refresh/redraw screen)
19
13
023
^S
XOF or DC3
Device Control 3: Suspend Transmission
20
14
024
^T
DC4
Device Control 4
(Traditional esp. VMS: display process stats)
21
15
025
^U
NAK
Negative Acknowledgement
(Most Systems: discard input line)
22
16
026
^V
SYN
Synchronous Idle
23
17
027
^W
ETB
End of Transmission Block
24
18
030
^X
CAN
Cancel
(Old: discard input line)
25
19
031
^Y
EM
End of Medium
(VMS: stronger user interrupt)
26
1A
032
^Z
SUB
Substitute
(VMS and Unix Bourne Shell: end of file)
(Unix C and tcsh Shells: suspend current process)
27
1B
033
^[
ESC
Escape
(Modern Terminals: introduces complex control sequence)
28
1C
034
^\
FS
File Separator
29
1D
035
^]
GS
Group Separator
30
1E
036
^^
RS
Record Separator
31
1F
037
^_
US
Unit Separator
32
20
040
 
SPA
Space
127
7F
177
 
DEL
Delete



British Character Set, BS-4730

"BS" is the British Standards Institute. This is a seven bit code, exactly the same as ASCII-1967, except:


Older ASCII versions

ASCII-1963 was the same as the current (1967) version execpt: ASCII-1965 was the same as the current (1967) version execpt: Summary of Version Differences

DecOctalHexASCII
1963
ASCII
1965
ASCII
current
BS-4730
354323
#
#
#
£
6410040
@
`
@
@
921345C
\
~
\
\
941365E
^
^
^
951375F
_
_
_
9614060
(unused)
@
`
`
97-122141-17261-7A
(unused)
a-z
a-z
a-z
1231737B
(unused)
{
{
{
1241747C
(unused)
|
|
1251757D
(unused)
}
}
}
1261767E
ESC
|
~
¯
1271777F
DEL
DEL
DEL
DEL




Punched Paper Tape

The most commonly seen punched paper tape used the seven-bit ASCII system, augmented with one Parity Bit


"Paper Tape $2\r\n"

Notice that in the above graphic, every row has an odd number of holes punched in it. That's all there is to parity, which is just an error detection method: if a character is misread, there is a 50-50 chance that the parity will be wrong. Just a single bit read incorrectly (common in paper tape) is guaranteed to be detected by checking parity. Actually, there is Even Parity and Odd Parity, you can guess what the difference is.

Interactive Paper-Tape punching demonstration applet: click here.

The tape is decoded by treating the holes as 1's, the lacks-of-hole as 0's, converting from binary and looking up the resulting number in a standard ASCII table, as shown above. The least significant bit is at the bottom, and the parity bit is in the most significant position (just ignore it after checking the number of holes is odd). So, starting from the left, the first pattern is 11010000, which has an odd number of 1's in it, so is acceptable, and reduced to 1010000. In hexadecimal, that is 50, which is the letter 'P' in the ASCII tables. The whole message reads "Paper Tape $2" followed by a carriage return and line feed.

The continuous line of little holes are just sproket holes, used to pull the tape through the punch and reader cheaply and efficiently; they also serve to show which way round the tape is: being asymmetrically placed, the tape won't go into the machine the wrong way up.

Paper tape was very popular until the end of the 1970's. It is a very cheap and robust medium. Electromechanical readers could read anywhere from 10 to about 200 characters per second; Optical ones (just passing light through the holes) could work many times faster than that: at least 4000 characters per second, perhaps more.