ASCII Programmer reference

ASCII Chart

ASCII Character Set

This page shows a chart and table of the American Standard Code for Information Interchange (ASCII) character set. Each ASCII character has a corresponding 7-bit code; practically all modern computers follow this correspondence in their character displays. Note that the coding for ASCII characters runs from 00 to 7F (hex). Characters from 80 to FF (hex) (using an 8-bit code with the MSB set to 1) are not defined in ASCII. Use of these additional codes varies widely among computer systems.

Physical Device Controls: Format Effectors

BS: Backspace

HT: Horizontal Tab

LF: Line Feed

VT: Vertical Tab

FF: Form Feed

CR: Carriage Return

Physical Device Controls: Other

BEL: Bell

DC1, DC2, DC3, DC4: No assigned meaning in ASCII, but DC1 and DC3 are used for XON and XOFF in most software handshaking schemes.

Logical Communications Controls

SOH: Start of Header

STX: Start of Text

ETX: End of Text

EOT: End of Transmission

ENQ: Enquiry

ACK: Acknowledge

DLE: Data Link Escape

NAK: Negative Acknowledge

SYN: Synchronous Idle

ETB: End of Transmission Block

Physical Communications Controls

NUL: Null

DEL: Delete

CAN: Cancel

EM: End of Medium

SUB: Substitute

Information Separators

FS: File Separator

GS: Group Separator

RS: Record Separator

US: Unit Separator

Controls for Code Extensions

SI: Shift In

SO: Shift Out

ESC: Escape

Here's a nice trick for sending control characters. On most keyboards, rows 4 and 5 (or rows 6 and 7) of the ASCII chart are mapped onto rows 0 and 1 by way of a modifier key, usually the control key on a keyboard. For example, to generate a linefeed, press control-J; to generate a carriage return, press control-M, etc. look in the corresponding line of the same column in the table above. The Macintosh, PC, and Sun keyboards supports most of this mapping. On OpenBSD, man ascii.