C0 and C1 Control Codes - C0 (ASCII and Derivatives)

C0 (ASCII and Derivatives)

These are the standard ASCII control codes. If using the ISO/IEC 2022 extension mechanism, they are designated as the active C0 control character set with the octet sequence 0x1B 0x21 0x40 (ESC ! @).

Seq Dec Hex Acro Symb Name C Description
^@ 00 00 NUL Null \0 Originally used to allow gaps to be left on paper tape for edits. Later used for padding after a code that might take a terminal some time to process (e.g. a carriage return or line feed on a printing terminal). Now often used as a string terminator, especially in the C programming language.
^A 01 01 SOH Start of Heading First character of a message header.
^B 02 02 STX Start of text First character of message text, and may be used to terminate the message heading.
^C 03 03 ETX End of Text Often used as a "break" character (Ctrl-C) to interrupt or terminate a program or process.
^D 04 04 EOT End of Transmission Used on Unix to signal end-of-file condition on, or to logout from a terminal.
^E 05 05 ENQ Enquiry Signal intended to trigger a response at the receiving end, to see if it is still present.
^F 06 06 ACK Acknowledge Response to an ENQ, or an indication of successful receipt of a message.
^G 07 07 BEL Bell \a Originally used to sound a bell on the terminal. Later used for a beep on systems that didn't have a physical bell. May also quickly turn on and off inverse video (a visual bell).
^H 08 08 BS Backspace \b Move the cursor one position leftwards. On input, this may delete the character to the left of the cursor. On output, where in early computer technology a character once printed could not be erased, the backspace was sometimes used to generate accented characters in ASCII. For example, à could be produced using the three character sequence a BS ` (0x61 0x08 0x60). This usage is now deprecated and generally not supported. To provide disambiguation between the two potential uses of backspace, the cancel character control code was made part of the standard C1 control set.
^I 09 09 HT Character Tabulation, Horizontal Tabulation \t Position to the next character tab stop.
^J 10 0A LF Line Feed \n On typewriters, printers, and some terminal emulators, moves the cursor down one row without affecting its column position. On Unix, used to mark end-of-line. In MS-DOS, Windows, and various network standards, LF is used following CR as part of the end-of-line mark.
^K 11 0B VT Line Tabulation, Vertical Tabulation \v Position the form at the next line tab stop.
^L 12 0C FF Form Feed \f On printers, load the next page. Treated as whitespace in many programming languages, and may be used to separate logical divisions in code. In some terminal emulators, it clears the screen.
^M 13 0D CR Carriage Return \r Originally used to move the cursor to column zero while staying on the same line. On Mac OS (pre-Mac OS X), as well as in earlier systems such as the Apple II and Commodore 64, used to mark end-of-line. In MS-DOS, Windows, and various network standards, it is used preceding LF as part of the end-of-line mark. The Enter or Return key on a keyboard will send this character, but it may be converted to a different end-of-line sequence by a terminal program.
^N 14 0E SO Shift Out Switch to an alternate character set.
^O 15 0F SI Shift In Return to regular character set after Shift Out.
^P 16 10 DLE Data Link Escape Cause the following octets to be interpreted as raw data, not as control codes or graphic characters. Returning to normal usage would be implementation dependent.
^Q 17 11 DC1 Device Control One (XON) These four control codes are reserved for device control, with the interpretation dependent upon the device they were connected. DC1 and DC2 were intended primarily to indicate activating a device while DC3 and DC4 were intended primarily to indicate pausing or turning off a device. In actual practice DC1 and DC3 (known also as XON and XOFF respectively in this usage) quickly became the de facto standard for software flow control.
^R 18 12 DC2 Device Control Two
^S 19 13 DC3 Device Control Three (XOFF)
^T 20 14 DC4 Device Control Four
^U 21 15 NAK Negative Acknowledge Sent by a station as a negative response to the station with which the connection has been set up. In binary synchronous communication protocol, the NAK is used to indicate that an error was detected in the previously received block and that the receiver is ready to accept retransmission of that block. In multipoint systems, the NAK is used as the not-ready reply to a poll.
^V 22 16 SYN Synchronous Idle Used in synchronous transmission systems to provide a signal from which synchronous correction may be achieved between data terminal equipment, particularly when no other character is being transmitted.
^W 23 17 ETB End of Transmission Block Indicates the end of a transmission block of data when data are divided into such blocks for transmission purposes.
^X 24 18 CAN Cancel Indicates that the data preceding it are in error or are to be disregarded.
^Y 25 19 EM End of medium Intended as means of indicating on paper or magnetic tapes that the end of the usable portion of the tape had been reached.
^Z 26 1A SUB Substitute Originally intended for use as a transmission control character to indicate that garbled or invalid characters had been received. It has often been put to use for other purposes when the in-band signaling of errors it provides is unneeded, especially where robust methods of error detection and correction are used, or where errors are expected to be rare enough to make using the character for other purposes advisable.
^[ 27 1B ESC Escape The Esc key on the keyboard will cause this character to be sent on most systems. It can be used in software user interfaces to exit from a screen, menu, or mode, or in device-control protocols (e.g., printers and terminals) to signal that what follows is a special command sequence rather than normal text. In systems based on ISO/IEC 2022, even if another set of C0 control codes are used, this octet is required to always represent the escape character.
^\ 28 1C FS File Separator Can be used as delimiters to mark fields of data structures. If used for hierarchical levels, US is the lowest level (dividing plain-text data items), while RS, GS, and FS are of increasing level to divide groups made up of items of the level beneath it.
^] 29 1D GS Group separator
^^ 30 1E RS Record Separator
^_ 31 1F US Unit separator
While not technically part of the C0 control character range, the following two characters are defined in ISO/IEC 2022 as always being available regardless of which sets of control characters and graphics characters have been registered. They can be thought of as having some characteristics of control characters.
32 20 SP Space Space is a graphic character. It has a visual representation consisting of the absence of a graphic symbol. It causes the active position to be advanced by one character position. In some applications, Space can be considered a lowest-level "word separator" to be used with the adjacent separator characters.
^? 127 7F DEL Delete Not technically part of the C0 control character range, this was originally used to mark deleted characters on paper tape, since any character could be changed to all ones by punching holes everywhere. On VT100 compatible terminals, this is the character generated by the key labelled ⌫, usually called backspace on modern machines, and does not correspond to the PC delete key.

Read more about this topic:  C0 And C1 Control Codes