Every ANSI escape sequence, one URL each
A canonical reference for ANSI / VT terminal escape codes — SGR colors, cursor control, screen modes, OSC sequences. Each sequence has its own page with byte forms (\x1b[, \033[, \e[, ESC [), a spec citation, working examples in 5 languages, and a per-terminal support row.
\x1b[1;31mERROR\x1b[0m \x1b[32m✓ ok\x1b[0mERROR ✓ okWhat's inside
Per-sequence reference
141 high-value sequences spanning ECMA-48, xterm-ctlseqs, DEC private modes, sixel graphics, and the Kitty graphics protocol. One stable URL per code.
Live decoder
Paste any escape-laden string. We tokenize every byte and render the result side by side.
Terminal support matrix
15 features × 14 terminals (12 emulators + tmux + GNU screen) — see at a glance which escape sequence is safe for your target environment.
Tools & references
Beyond the per-sequence pages — short, focused references for everything you'd google around ANSI escape codes.
- Strip ANSI codesCanonical PCRE regex plus copy-paste recipes for Python, JavaScript, Go, Rust, Bash, and C.
- Common pitfallsSymptom → cause → fix for color bleed, NO_COLOR, alt screen, screen readers, and other once-bitten-twice-shy gotchas.
- terminfo mappingWhat every tput capability actually expands to on xterm-256color — 49 caps across attributes, colour, cursor, erase, screen modes, and keyboard input.
- Dataset (JSON / CSV)Every sequence on this site packaged as one structured file. Stable schema with byte forms, families, examples, and per-terminal support.
- ANSI in your shellBash printf vs $'\e[…]', zsh %F{red}%f, fish set_color, PowerShell $PSStyle, cmd.exe / batch ESC tricks — five shell syntaxes side by side.
- ECMA-48 vs xterm-ctlseqsThree portability tiers in one table — which sequences are ISO 6429, which are xterm extensions, and which are vendor-specific (kitty graphics, sixel, iTerm2, contour).
- Decode in the wildBookmarklet plus nine CLI recipes — Python, Node, Deno, Rust, Go, and PowerShell inline tokenizers, awk, less -R, and docker / kubectl / journalctl in production.
- Accessibility & NO_COLORHow NO_COLOR, CLICOLOR, FORCE_COLOR, TERM=dumb, and isatty interact — plus how screen readers handle escape-laden output.
- 256-color paletteVisual reference for every xterm 256-color index — system palette, 6×6×6 RGB cube, and 24-step grayscale. Tap a swatch to copy the SGR escape.
- ANSI test patternSide-by-side browser preview and curl-pipeable shell script — 16 basic colours, the 256-palette, 24-bit truecolor gradient, every SGR attribute, OSC 8 hyperlink, OSC 0 title. See exactly what your terminal supports.
- ANSI in CI logsPer-CI quirks: why CI strips colour, the GitHub Actions ::group:: + GitLab section_start markers, the Jenkins AnsiColor plugin, FORCE_COLOR / --color=always overrides, and viewing raw logs locally.
- Git colour configcolor.ui / per-command keys / the slot palette / core.pager + LESS=FRX / piping --color=always into less -R or bat — the full git colour configuration map.
- LS_COLORS env varGNU ls LS_COLORS syntax (type tokens + extension tokens), dircolors workflow, the BSD LSCOLORS divergence (a totally different fixed-position format), eza / exa analogues.
- GREP_COLORS env varLegacy GREP_COLOR vs current GREP_COLORS per-slot env, --color={auto,always,never}, ripgrep --colors dotted syntax, ag --color-* flags, the pipe-into-grep trap.
- LESS / man-page coloursLESS_TERMCAP_md/me/us/ue/so/se for coloured man pages, LESS=R for SGR passthrough, MANPAGER='less -R' + MANROFFOPT=-c, lesspipe, bat / delta / diff-so-fancy.
- Terminal keymapInput-side reference — arrow keys + DECCKM, modifier convention \e[1;5A, F1–F12 layout, Home/End/Backspace fragmentation, kitty CSI u protocol, lone-ESC timeout.
Browse by family
Every sequence on the site belongs to one of seven wire-protocol families. The family pages list every sequence in that family on one URL — handy when you know the family shape (SGR, CSI, OSC …) but not the specific code.
Popular sequences
The 30 escape sequences developers look up most — every SGR colour and attribute, the CSI cursor and erase family, the alt-screen / cursor-visibility DEC modes, and the OSC 8 hyperlink protocol. The remaining 111 sequences live in the full index.
- SGR 0 — Reset / Normal
\x1b[0mClear all text attributes and colors back to the terminal default.
- SGR 1 — Bold / Increased intensity
\x1b[1mRender following text in bold (or bright on some terminals).
- SGR 2 — Dim / Faint
\x1b[2mRender following text at reduced intensity (faint).
- SGR 3 — Italic
\x1b[3mRender following text in italic; not universally supported.
- SGR 4 — Underline
\x1b[4mRender following text with an underline.
- SGR 7 — Reverse video
\x1b[7mSwap foreground and background colors.
- SGR 9 — Strikethrough
\x1b[9mRender following text with a horizontal line through it.
- SGR 39 — Default foreground color
\x1b[39mReset only the foreground color (leaves attributes + bg intact).
- SGR 49 — Default background color
\x1b[49mReset only the background color (leaves attributes + fg intact).
- SGR 30–37 — Foreground color (8 basic)
\x1b[31m (red, similarly 30–37)Set foreground to one of black/red/green/yellow/blue/magenta/cyan/white.
- SGR 40–47 — Background color (8 basic)
\x1b[41m (red bg, 40–47)Set background to one of black/red/green/yellow/blue/magenta/cyan/white.
- SGR 90–97 — Bright foreground color
\x1b[91m (bright red, 90–97)Bright variants of the 8 basic foreground colors (aixterm/xterm extension).
- SGR 100–107 — Bright background color
\x1b[101m (bright red bg, 100–107)Bright variants of the 8 basic background colors.
- SGR 38;5;n — 256-color foreground
\x1b[38;5;NmPick a foreground color from the 256-color xterm palette.
- SGR 48;5;n — 256-color background
\x1b[48;5;NmPick a background color from the 256-color xterm palette.
- SGR 38;2;R;G;B — 24-bit truecolor foreground
\x1b[38;2;R;G;BmPick any of 16,777,216 foreground RGB colors directly.
- SGR 48;2;R;G;B — 24-bit truecolor background
\x1b[48;2;R;G;BmPick any of 16,777,216 background RGB colors directly.
- CUU / CUD / CUF / CUB — Move cursor
\x1b[NA (up; B down, C right, D left)Move the cursor up / down / right / left by N cells.
- CUP — Set cursor position
\x1b[row;colHMove the cursor to absolute row/column (1-indexed).
- CHA — Cursor horizontal absolute (column)
\x1b[NGMove the cursor to column N of the current row (1-indexed).
- DECSC / DECRC — Save and restore cursor
\x1b7 (save) \x1b8 (restore)Push and pop the cursor state (position + attributes).
- CNL / CPL — Cursor next / previous line
\x1b[NE (down N lines, col 1) \x1b[NF (up)Move the cursor to column 1 of the line N below (CNL) or above (CPL).
- ED — Erase in display (\x1b[2J clear screen)
\x1b[NJErase part or all of the screen.
- EL — Erase in line (\x1b[K)
\x1b[NKErase part or all of the current line.
- DECSET 1049 — Alternate screen buffer
\x1b[?1049h (enter) \x1b[?1049l (leave)Switch to a separate screen buffer (like vim/less do on launch).
- DECTCEM ?25 — Show/hide cursor
\x1b[?25h (show) \x1b[?25l (hide)Show or hide the text cursor.
- DECSET ?2004 — Bracketed paste mode
\x1b[?2004h (enable) \x1b[?2004l (disable)Wrap pasted text in distinct escape markers so apps can tell paste from typing.
- OSC 8 — Inline hyperlink
\x1b]8;;URI\x07TEXT\x1b]8;;\x07Render clickable hyperlinks in terminal output (gnome-terminal 3.26+, iTerm2, Windows Terminal, kitty, ...).
- OSC 0 / 2 — Set window/icon title
\x1b]0;TITLE\x07Change the terminal window's title bar text.
- RIS — Reset to Initial State (full terminal reset)
\x1bcHard reset the terminal: clear screen + scrollback, reset every mode and SGR, home the cursor.