Douglas Crockford




2021 Appearances





How JavaScript Works




The American Standard Code for Information Interchange was developed in the 1960s for use in teletype machines and similar devices. It also anticipated use by computers, although computer networking at the time was still largely theoretical. It was not intended to be used as an internal computer character set, but it became the standard character set, partly due to the influence of UNIX. It still exists today as the first 128 code points of Unicode.

0 1 2 3 4 5 6 7 8 9 A B C D E F
0 nul soh stx etx eot enq ack bel bs tab lf vt ff cr so si
1 dle dc1 dc2 dc3 dc4 nak syn etb can em sub esc fs gs rs us
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 { | } ~ del

The first 32 characters and the last character are control codes. Each control code has a very specific function.

Paper Tape:

null. ASCII was designed specifically for use with punched paper tape. A reel of paper tape is a stream of rows. Each row contains one character. A hole in the tape represented a 1 bit. A row with no punches was empty tape, or leader. A character containing only 0 bits should be ignored by the receiver.
delete. To delete a character on a paper tape, punch out all of the holes in the row. A character containing only 1 bits should be ignored by the receiver.
device control one. Turn the paper tape reader on.
device control two. Turn the paper tape puncher on.
device control three. Turn the paper tape reader off.
device control four. Turn the paper tape puncher off.

Format Effectors:

backspace. Move the print head back one space. This was not a deletion. Deletion is done on the paper tape with del.
tabulation. Advance to the next tabstop. ASCII did not provide a way to define tabstops, nor did it define a default tab spacing. We still do not have an international tabstop standard. tab was not intended to be a data separator. That was what us was for.
carriage return. Move the print head to the left edge. Some terminals could not complete the move in a single character time, so lf and nul characters would be sent to prevent the printing of a character in the middle of the page.
line feed. Roll the paper ahead one line. lf was usually issued after cr because moving the print head to the left edge could be slow. The paper could be rolled while the print head was still in motion. This character is sometimes called newline.
form feed. Eject the current page, advancing to the top of the next page.
vertical tabulation. Roll the paper ahead to the next vertical tabstop. ASCII did not provide a way to define vertical tabstops, nor did it define a default vertical tab spacing.


start of heading. A message could have an optional header that could include delivery or routing information.
start of text. A message starts with this character.
end of text. A message ends with this character. Sometimes it is followed by an error detection code such as CRC-16.
end of tranmission block. This allowed for breaking a long message into smaller blocks that could be individually acknowledged.
acknowledge. The message was received.
negative acknowledge. The message was not received correctly. In most cases, similar control characters have similar codes, but ack and nak were separated to give more resistence against transmission errors. It would require three bit errors to transform ack into nak.
end of transmission.
end of medium. This could mark the end of a tape.
enquiry. Ask the other station to identify itself. Some teletypes, on receiving this character, would automatically reply with a preprogrammed string.
bell. Ring the bell to get the operator's attention.
synchronous idle. In the synchronous transmission mode, the channel is given a steady stream of bits with no framing bits around the characters. The two stations synchronize a character clock so that they agree on when it is time to start the next character. When a sender has nothing to send, it sends the syn character. The receiver can look for a pattern of syn characters for synchronization.
cancel. The remainder of the message will not be sent. Oops.
substitute. The character that was supposed to be sent was somehow lost. Oops.


shift out. Switch to an alternate character set. Early in the design of ASCII, this was going to be used to access lower case, similar to the use of shift on typewriter keyboards. so and si were retained for accessing an alternate character set. It was sometimes used to select the ribbon color.
shift in.
escape. esc was another way of accessing an alternate character set. One use of esc was to add an eighth bit to the next character.
data link escape. Do not treat the next character as a control character.

Information Separators:

unit separator.
record separator.
group separator.
file separator.

Some of these codes are still reflected in modern keyboards (del bs tab esc) but now have very different meanings. The original purpose of the ctrl key was to generate these control characters by subtracting 64 from certain codes. ctrlA generated soh. ctrlZ generated sub. Six of the control characters could be generated by using ctrlshift together.