ASCII 27
ASCII 27 is Escape — the control character ESC.
Every representation
| Character | ESC (not printable) |
| Name | Escape |
| Decimal | 27 |
| Hexadecimal | 0x1B |
| Octal | 0033 |
| Binary | 00011011 |
| HTML entity |  |
| Escape sequence | \\e |
| Unicode | U+001B |
| Keyboard | Ctrl+[ |
| Group | Control 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
- ASCII 20 — DC4
- ASCII 21 — NAK
- ASCII 22 — SYN
- ASCII 23 — ETB
- ASCII 24 — CAN
- ASCII 25 — EM
- ASCII 26 — SUB
- ASCII 28 — FS
- ASCII 29 — GS
- ASCII 30 — RS
- ASCII 31 — US
- ASCII 32 — space
- ASCII 33 — !
- ASCII 34 — "
Full ASCII table · Text to binary converter · Number base converter