Back
Asciify Logo
Asciify
SUBFS

Escape

ESC (Escape) is ASCII code point 27 (0x1B), Unicode U+001B. It is a C0 control character that shifts the meaning of the bytes that follow it — the foundation of every ANSI/VT escape sequence used in terminals today. A single 0x1B followed by "[" (forming CSI) introduces commands for cursor movement, text color, scrolling, and screen clearing in xterm, GNOME Terminal, iTerm2, and virtually every modern emulator. Ctrl+[ emits it, which is why that keystroke functions as an Escape key alternative in vim. The byte is so central to terminal I/O that raw-mode parsers must always buffer after receiving 0x1B to determine whether it is a lone keypress or the start of a multi-byte sequence. UTF-8 encodes it as the single byte 0x1B; Unicode classifies it as Cc (Control) with the alias ESCAPE.

Symbol

Technical Details

Code Example

</>
char esc = 27; // ASCII ESC (0x1B)
char seq[] = {esc,'[','2','J','\0'}; // ANSI: clear screen
fputs(seq, stdout); // write escape sequence
fputs("Ready\n", stdout); // normal text resumes

Frequently Asked Questions

  • ESC (ASCII 27) is the gateway to every ANSI terminal command. Colors, cursor movement, screen clearing — they all start with ESC followed by a command sequence. Without it, your terminal would be limited to plain, unformatted text.

  • They're commands that start with ESC[ (called CSI — Control Sequence Introducer). For example, ESC[31m makes text red, ESC[2J clears the screen, and ESC[H moves the cursor home. Every modern terminal emulator supports them.

  • Yes. If untrusted input containing ESC bytes reaches a terminal, it can rewrite what's displayed — hiding malicious commands in logs, spoofing prompts, or even injecting clipboard content in some emulators. Always sanitize control characters in logs and user-visible output.

  • It's not a shortcut — Ctrl+[ literally generates ASCII 27, the same byte as the Escape key. This is because control characters are calculated by subtracting 64 from the character's ASCII value: '[' is 91, and 91−64=27. Vim users rely on this daily.

  • In Vim, press Ctrl+V then Escape. In Bash, press Ctrl+V then Ctrl+[ (or Esc). In most programming strings, use the hex escape \x1b or the octal \033.

  • Use a regex that matches the escape sequence pattern. A common one is `/[[0-9;]*m/g` for colors, but for full coverage of all ANSI codes, you need a more complex pattern or a dedicated library like 'strip-ansi'.

@workani&@alexluthor
Privacy & legal

Privacy

No accounts, no ads, no tracking cookies, and no cross-site tracking. The only analytics we keep are faceless — anonymous, aggregated counts of pages and searches, never tied to you. We store no IP addresses, set no tracking cookies, and build no profiles. Cloudflare hosts the site and handles requests for delivery and security.

Full privacy policy·Extension privacy·legal@asciify.dev

Attributions & licenses

Twemoji
© Twitter, Inc and other contributors · CC-BY 4.0
Noto Color Emoji
© Google · Apache 2.0
Fluent UI Emoji
© Microsoft · MIT
OpenMoji
© HfG Schwäbisch Gmünd · CC-BY-SA 4.0
Toss Face
© Viva Republica (Toss) · SIL OFL 1.1
JoyPixels
© JoyPixels Inc. · Free Limited Use License
SerenityOS Emoji
© The SerenityOS Developers · BSD-2-Clause
EmojiTwo
© EmojiTwo contributors · CC-BY 4.0
Apple Color Emoji
© Apple, Inc.
Facebook Emoji
© Meta Platforms, Inc.

Apple and Facebook emoji styles are proprietary and shown here solely for reference and comparison — a common-sense application of nominative-use / fair-use principles. asciify is not affiliated with, endorsed by, or sponsored by Apple, Inc., Meta Platforms, Inc., or any other rights holder listed above. If a rights holder requests removal of their emoji style from this site, it will be removed.

All other vendor emoji are reproduced for reference and comparison under their respective open licenses listed above.

Character names and code points from the Unicode® Standard. Unicode® and the Unicode Logo are registered trademarks of Unicode, Inc.

Privacy
© asciify.dev 2025-2026