Next / Previous / Index / ITC Help System / Publications / Site map / NM Tech homepage


Tech Computer Center logo
American Standard Code for Information Interchange: the standard way that printable (and other) characters are represented in the USA.

Here is a chart of the ASCII codes. Only 128 characters are defined, since it is a seven-bit code.

In the table below, to find the code for a given character, add the hexadecimal number at the top of its column to the number at the left of its row. For example, the code for "+" is hexadecimal 0x2B.

  | 00  10  20 30 40 50 60 70
0 | NUL DLE SP 0  @  P  `  p 
1 | SOH DC1 !  1  A  Q  a  q
2 | STX DC2 "  2  B  R  b  r
3 | ETX DC3 #  3  C  S  c  s
4 | EOT DC4 $  4  D  T  d  t
5 | ENQ NAK %  5  E  U  e  u
6 | ACK SYN &  6  F  V  f  v
7 | BEL ETB '  7  G  W  g  w
8 | BS  CAN (  8  H  X  h  x
9 | HT  EM  )  9  I  Y  i  y
A | LF  SUB *  :  J  Z  j  z
B | VT  ESC +  ;  K  [  k  {
C | FF  FS  ,  <  L  \  l  |
D | CR  GS  -  =  M  ]  m  }
E | SO  RS  .  >  N  ^  n  ~
F | SI  US  /  ?  O  _  o  DEL

Characters "!" through "~" are considered "printable"; the others are called "control characters". Many control characters can be transmitted from a keyboard through the use of the Control key. To find the code produced by the Control plus a letter, move four columns to the left. For example, the code for control-I is HT.

Here are notes on some of the more commonly used control characters:

When output to a terminal, BEL is supposed to make an audible beep.
This is the official backspace character of ASCII. Many operating systems (like Unix) or text editors (like emacs) instead use DEL for backspace, but this is nonstandard.
Cancel, or control-X, was originally intended for use to signal that the user wanted to cancel an entire input line. Most Unix systems, though, usually use control-U (NAK) for this function.
Carriage return. Historically, early Teletypes required two characters at the end of each line: LF (linefeed) rolled the platen up to move to the next line, while CR returned the print mechanism to the beginning of the line. MS-DOS systems still use both characters to terminate a line. However, Unix systems expect that the CR key (usually marked Return or Enter) on the keyboard is used to terminate a line, while only a linefeed character is actually stored at the end of each line when text is stored in files.
Delete. See BS for a discussion of the variations in designation of a backspace character.
Escape. This key is used for a wide variety of functions, but originally it was used as a prefix to modify the meaning of the following character.
Form feed. Usually forces printers to eject to the next page.
Horizontal tab. On most keyboards, this is the key just to the left of Q.
Line feed. Moves the cursor to the next line. See CR for a discussion of line terminators.
Also known as "Control-@" or control-shift-2. Has a code of zero, and is used in C to delimit strings.
Space; the character produced when you press the spacebar.

See also: Glossary: A
Previous: architecture
Site map
Index: Keyword index to help pages
Help: New Mexico Tech Information Technology and Communications: Help System
ITC Publications
To report a problem: File a ticket
Send mail to the User consultant on duty or call them at 575-835-5437
Home: About New Mexico Tech

John Shipman,
Last updated: 1995/12/01 02:04:39 UT
QR two-dimensional bar code