Toolman

ASCII 27

ASCII 27 is Escape — the control character ESC.

Every representation

CharacterESC (not printable)
NameEscape
Decimal27
Hexadecimal0x1B
Octal0033
Binary00011011
HTML entity
Escape sequence\\e
UnicodeU+001B
KeyboardCtrl+[
GroupControl character

What it is for

Introduces an escape sequence. Nearly all terminal colour, cursor movement and formatting is ESC followed by [ and parameters — the ANSI escape codes. It is also the byte your Esc key sends.

Where the number comes from

Codes 0 to 31 were reserved for control: instructions to a teleprinter rather than characters to print. Code 27 is Ctrl+[ because the Ctrl key was originally wired to clear the top two bits of whatever you typed, mapping the letter [ at 91 down to 27.

Frequently asked questions

What is ASCII 27?

Escape (ESC), a control character. In hexadecimal it is 0x1B, in octal 0033, and in binary 00011011.

How do I type ASCII 27?

Press Ctrl+[ in a terminal. In a string literal you can write it as \\e or \\x1B in most languages.

Is ASCII 27 printable?

No. Codes 0 to 31 and 127 are control characters — they were instructions to a teleprinter rather than marks on paper, and most terminals show nothing for them.

Nearby codes

Full ASCII table · Text to binary converter · Number base converter