ANSI Escape Reference

Searchable cheatsheet of ANSI / CSI terminal codes.

CategorySequenceNameDescription
Style \e[0m Reset Restore all default attributes
Style \e[1m Bold Bold or increased intensity
Style \e[2m Dim Faint or decreased intensity
Style \e[3m Italic Italic (not widely supported)
Style \e[4m Underline Underline
Style \e[5m Blink Slow blink
Style \e[7m Reverse Swap foreground and background
Style \e[8m Conceal Hidden text
Style \e[9m Strike Crossed out
Style \e[22m Normal Reset bold/dim
Style \e[24m No underline Disable underline
Style \e[27m No reverse Disable reverse
Fg color \e[30m Black Foreground black
Fg color \e[31m Red Foreground red
Fg color \e[32m Green Foreground green
Fg color \e[33m Yellow Foreground yellow
Fg color \e[34m Blue Foreground blue
Fg color \e[35m Magenta Foreground magenta
Fg color \e[36m Cyan Foreground cyan
Fg color \e[37m White Foreground white
Fg color \e[39m Default Reset foreground colour
Bg color \e[40m Black Background black
Bg color \e[41m Red Background red
Bg color \e[42m Green Background green
Bg color \e[43m Yellow Background yellow
Bg color \e[44m Blue Background blue
Bg color \e[45m Magenta Background magenta
Bg color \e[46m Cyan Background cyan
Bg color \e[47m White Background white
Bg color \e[49m Default Reset background colour
Bright fg \e[90m Bright black Bright (gray) foreground
Bright fg \e[91m Bright red Bright red foreground
Bright fg \e[92m Bright green Bright green foreground
Bright fg \e[93m Bright yellow Bright yellow foreground
Bright fg \e[94m Bright blue Bright blue foreground
Bright fg \e[95m Bright magenta Bright magenta foreground
Bright fg \e[96m Bright cyan Bright cyan foreground
Bright fg \e[97m Bright white Bright white foreground
Extended color \e[38;5;Nm 256-color fg N = 0..255
Extended color \e[48;5;Nm 256-color bg N = 0..255
Extended color \e[38;2;R;G;Bm Truecolor fg 24-bit RGB foreground
Extended color \e[48;2;R;G;Bm Truecolor bg 24-bit RGB background
Cursor \e[H Home Move to top-left
Cursor \e[r;cH Move to Row r, column c (1-based)
Cursor \e[nA Up n Move cursor up n rows
Cursor \e[nB Down n Move cursor down n rows
Cursor \e[nC Right n Move cursor right n columns
Cursor \e[nD Left n Move cursor left n columns
Cursor \e[s Save Save cursor position
Cursor \e[u Restore Restore saved cursor
Cursor \e[?25l Hide Hide cursor
Cursor \e[?25h Show Show cursor
Screen \e[2J Clear Erase entire screen
Screen \e[K Clear line Erase to end of line
Screen \e[2K Clear line full Erase entire line
Screen \e[?1049h Alt screen Enter alternate buffer
Screen \e[?1049l Main screen Leave alternate buffer

About this tool

Reference table for ANSI escape sequences — text styles, foreground/background colors, cursor movement and screen control. Filter by category or search by name.

An unhandled error has occurred. Reload ×