Control character


Control character is a code point (a number) in a character set, that does not represent a written Character.

All entries in the ASCII table below code 32 are of this kind, including CR and LF used to separate lines of text. The code 127 (DEL) is also a Control character.

Extended ASCII sets defined by ISO 8859 added the codes 128 through 159 as Control character, this was primarily done so that if the high bit was stripped it would not change a printing character to a older control code, but there have been some assignments here, in particular NEL.

These 65 Control character were carried over to Unicode. Unicode added more characters that could be considered controls, but it makes a distinction between these "Formatting characters" (such as the Zero-width non-joiner), and the 65 Control characters.

The Extended Binary Coded Decimal Interchange Code (EBCDIC) character set contains 65 Control character, including all of the ASCII Control character as well as additional codes which are mostly used to control IBM peripherals.

C0 Control characters#

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 ! @).
^@0000NULNull\0Originally 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 programming language C.
^A0101SOHStart of Heading First character of a message header. In Hadoop, it is often used as a field separator.
^B0202STXStart of Text First character of message text, and may be used to terminate the message heading.
^C0303ETXEnd of Text Often used as a "break" character (Ctrl-C) to interrupt or terminate a program or process.
^D0404EOTEnd of Transmission Often used on Unix to indicate end-of-file on a terminal.
^E0505ENQEnquiry Signal intended to trigger a response at the receiving end, to see if it is still present.
^F0606ACKAcknowledgement Response to an ENQ, or an indication of successful receipt of a message.
^G0707BELBell, Alert
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).
^H0808BSBackspace\bMove 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 ` (or, using the characters’ hex values, 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.
^I0909HTCharacter Tabulation, Horizontal Tabulation\tPosition to the next character tab stop.
^J100ALFLine Feed\nOn 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 DOS, Windows, and various network standards, LF is used following CR as part of the end-of-line mark.
^K110BVTLine Tabulation, Vertical Tabulation\vPosition the form at the next line tab stop.
^L120CFFForm Feed\fOn 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. It still appears in some common plain text files as a page break character, such as the RFCs published by IETF.
^M130DCRCarriage Return\rOriginally used to move the cursor to column zero while staying on the same line. On classic MacOS (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 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.
^N140ESOShift Out Switch to an alternative character set.
^O150FSIShift In Return to regular character set after Shift Out.
^P1610DLEData 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.
^Q1711DC1Device 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.citation needed
^R1812DC2Device Control Two
^S1913DC3Device Control Three (XOFF)
^T2014DC4Device Control Four
^U2115NAKNegative-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.
^V2216SYNSynchronous 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.
^W2317ETBEnd of Transmission Block Indicates the end of a transmission block of data when data are divided into such blocks for transmission purposes.
^X2418CANCancel Indicates that the data preceding it are in error or are to be disregarded.
^Y2519EMEnd 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.
^Z261ASUBSubstitute 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. In DOS, Windows and other CP/M derivatives, it is used to indicate the end of file, both when typing on the terminal, and sometimes in text files stored on disk.
^[271BESCEscape character\eThe 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.
^\281CFSFile 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.
^]291DGSGroup Separator
^^301ERSRecord Separator
^_311FUSUnit Separator
3220SPSPACE Space is a graphic character. It has a Data representation consisting of the absence of a Image 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.
^?1277FDELDelete 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.

While not technically part of the C0 control character range, the following two characters SPACE and Delete 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.

More Information#

There might be more information for this subject on one of the following: