Skip to main content
ansicode

ANSI test pattern — interactive browser preview + curl-pipeable shell script

Two parallel renderings of the same byte sequence. The browser preview below shows what every section LOOKS like once a terminal interprets it; the `curl … | sh` command at the top streams the identical bytes into your real terminal so you can spot which features your emulator supports (24-bit truecolor smoothness, italic SGR, OSC 8 hyperlinks). Drift between the two columns isolates exactly which capability is missing.

Run it in your terminal

Pipe directly into `sh` for a one-shot run, or save the file first to inspect it before executing. The script is plain POSIX sh — no bash-isms, no sudo, no network calls beyond the initial fetch — so it runs identically on macOS bsd-sh, Debian dash, busybox ash, and every bash from 3.2 onward.

one-liner
curl -fsSL https://ansicode.eversources.app/test.sh | sh
save + inspect first
curl -fsSL https://ansicode.eversources.app/test.sh -o test.sh && less -R test.sh

Habit check: `curl | sh` is convenient but trusts whatever bytes the host returns. The save-first form lets you `less -R test.sh` to read the script before piping it into a shell — recommended for any first-time fetch, even from a site you trust. The script's source is also published on GitHub via the repository link in the page footer.

Test pattern sections

16 basic foreground colours · SGR 30–37 / 90–97

Two rows — the ECMA-48 8-colour set (30–37) and the xterm bright variants (90–97). Every modern terminal renders both; on legacy palettes the bright row may match the bold-on-normal variant.

rendered (browser)
Black Red Green Yellow Blue Magenta Cyan White
Black Red Green Yellow Blue Magenta Cyan White
raw bytes (\x1b literal form)
\x1b[30mBlack   \x1b[0m\x1b[31mRed     \x1b[0m\x1b[32mGreen   \x1b[0m\x1b[33mYellow  \x1b[0m\x1b[34mBlue    \x1b[0m\x1b[35mMagenta \x1b[0m\x1b[36mCyan    \x1b[0m\x1b[37mWhite   \x1b[0m
\x1b[90mBlack   \x1b[0m\x1b[91mRed     \x1b[0m\x1b[92mGreen   \x1b[0m\x1b[93mYellow  \x1b[0m\x1b[94mBlue    \x1b[0m\x1b[95mMagenta \x1b[0m\x1b[96mCyan    \x1b[0m\x1b[97mWhite   \x1b[0m

16 basic background colours · SGR 40–47 / 100–107

Same eight hues as backgrounds, with a contrasting foreground stamped on each so the colour shows. The bright row (100–107) is the high-intensity background extension — well supported but never standardised in ECMA-48.

rendered (browser)
Black Red Green Yellow Blue Magenta Cyan White
Black Red Green Yellow Blue Magenta Cyan White
raw bytes (\x1b literal form)
\x1b[37;40m Black  \x1b[0m\x1b[30;41m Red    \x1b[0m\x1b[30;42m Green  \x1b[0m\x1b[30;43m Yellow \x1b[0m\x1b[30;44m Blue   \x1b[0m\x1b[30;45m Magenta\x1b[0m\x1b[30;46m Cyan   \x1b[0m\x1b[30;47m White  \x1b[0m
\x1b[37;100m Black  \x1b[0m\x1b[30;101m Red    \x1b[0m\x1b[30;102m Green  \x1b[0m\x1b[30;103m Yellow \x1b[0m\x1b[30;104m Blue   \x1b[0m\x1b[30;105m Magenta\x1b[0m\x1b[30;106m Cyan   \x1b[0m\x1b[30;107m White  \x1b[0m

256-colour palette · SGR 48;5;n

All 256 indexed colours laid out 32-per-row × 8 rows. Indexes 0–15 mirror the basic + bright set above; 16–231 are the 6×6×6 RGB cube; 232–255 are the 24-step grayscale ramp.

rendered (browser)
raw bytes (\x1b literal form)
\x1b[48;5;0m  \x1b[0m\x1b[48;5;1m  \x1b[0m\x1b[48;5;2m  \x1b[0m\x1b[48;5;3m  \x1b[0m\x1b[48;5;4m  \x1b[0m\x1b[48;5;5m  \x1b[0m\x1b[48;5;6m  \x1b[0m\x1b[48;5;7m  \x1b[0m\x1b[48;5;8m  \x1b[0m\x1b[48;5;9m  \x1b[0m\x1b[48;5;10m  \x1b[0m\x1b[48;5;11m  \x1b[0m\x1b[48;5;12m  \x1b[0m\x1b[48;5;13m  \x1b[0m\x1b[48;5;14m  \x1b[0m\x1b[48;5;15m  \x1b[0m\x1b[48;5;16m  \x1b[0m\x1b[48;5;17m  \x1b[0m\x1b[48;5;18m  \x1b[0m\x1b[48;5;19m  \x1b[0m\x1b[48;5;20m  \x1b[0m\x1b[48;5;21m  \x1b[0m\x1b[48;5;22m  \x1b[0m\x1b[48;5;23m  \x1b[0m\x1b[48;5;24m  \x1b[0m\x1b[48;5;25m  \x1b[0m\x1b[48;5;26m  \x1b[0m\x1b[48;5;27m  \x1b[0m\x1b[48;5;28m  \x1b[0m\x1b[48;5;29m  \x1b[0m\x1b[48;5;30m  \x1b[0m\x1b[48;5;31m  \x1b[0m
\x1b[48;5;32m  \x1b[0m\x1b[48;5;33m  \x1b[0m\x1b[48;5;34m  \x1b[0m\x1b[48;5;35m  \x1b[0m\x1b[48;5;36m  \x1b[0m\x1b[48;5;37m  \x1b[0m\x1b[48;5;38m  \x1b[0m\x1b[48;5;39m  \x1b[0m\x1b[48;5;40m  \x1b[0m\x1b[48;5;41m  \x1b[0m\x1b[48;5;42m  \x1b[0m\x1b[48;5;43m  \x1b[0m\x1b[48;5;44m  \x1b[0m\x1b[48;5;45m  \x1b[0m\x1b[48;5;46m  \x1b[0m\x1b[48;5;47m  \x1b[0m\x1b[48;5;48m  \x1b[0m\x1b[48;5;49m  \x1b[0m\x1b[48;5;50m  \x1b[0m\x1b[48;5;51m  \x1b[0m\x1b[48;5;52m  \x1b[0m\x1b[48;5;53m  \x1b[0m\x1b[48;5;54m  \x1b[0m\x1b[48;5;55m  \x1b[0m\x1b[48;5;56m  \x1b[0m\x1b[48;5;57m  \x1b[0m\x1b[48;5;58m  \x1b[0m\x1b[48;5;59m  \x1b[0m\x1b[48;5;60m  \x1b[0m\x1b[48;5;61m  \x1b[0m\x1b[48;5;62m  \x1b[0m\x1b[48;5;63m  \x1b[0m
\x1b[48;5;64m  \x1b[0m\x1b[48;5;65m  \x1b[0m\x1b[48;5;66m  \x1b[0m\x1b[48;5;67m  \x1b[0m\x1b[48;5;68m  \x1b[0m\x1b[48;5;69m  \x1b[0m\x1b[48;5;70m  \x1b[0m\x1b[48;5;71m  \x1b[0m\x1b[48;5;72m  \x1b[0m\x1b[48;5;73m  \x1b[0m\x1b[48;5;74m  \x1b[0m\x1b[48;5;75m  \x1b[0m\x1b[48;5;76m  \x1b[0m\x1b[48;5;77m  \x1b[0m\x1b[48;5;78m  \x1b[0m\x1b[48;5;79m  \x1b[0m\x1b[48;5;80m  \x1b[0m\x1b[48;5;81m  \x1b[0m\x1b[48;5;82m  \x1b[0m\x1b[48;5;83m  \x1b[0m\x1b[48;5;84m  \x1b[0m\x1b[48;5;85m  \x1b[0m\x1b[48;5;86m  \x1b[0m\x1b[48;5;87m  \x1b[0m\x1b[48;5;88m  \x1b[0m\x1b[48;5;89m  \x1b[0m\x1b[48;5;90m  \x1b[0m\x1b[48;5;91m  \x1b[0m\x1b[48;5;92m  \x1b[0m\x1b[48;5;93m  \x1b[0m\x1b[48;5;94m  \x1b[0m\x1b[48;5;95m  \x1b[0m
\x1b[48;5;96m  \x1b[0m\x1b[48;5;97m  \x1b[0m\x1b[48;5;98m  \x1b[0m\x1b[48;5;99m  \x1b[0m\x1b[48;5;100m  \x1b[0m\x1b[48;5;101m  \x1b[0m\x1b[48;5;102m  \x1b[0m\x1b[48;5;103m  \x1b[0m\x1b[48;5;104m  \x1b[0m\x1b[48;5;105m  \x1b[0m\x1b[48;5;106m  \x1b[0m\x1b[48;5;107m  \x1b[0m\x1b[48;5;108m  \x1b[0m\x1b[48;5;109m  \x1b[0m\x1b[48;5;110m  \x1b[0m\x1b[48;5;111m  \x1b[0m\x1b[48;5;112m  \x1b[0m\x1b[48;5;113m  \x1b[0m\x1b[48;5;114m  \x1b[0m\x1b[48;5;115m  \x1b[0m\x1b[48;5;116m  \x1b[0m\x1b[48;5;117m  \x1b[0m\x1b[48;5;118m  \x1b[0m\x1b[48;5;119m  \x1b[0m\x1b[48;5;120m  \x1b[0m\x1b[48;5;121m  \x1b[0m\x1b[48;5;122m  \x1b[0m\x1b[48;5;123m  \x1b[0m\x1b[48;5;124m  \x1b[0m\x1b[48;5;125m  \x1b[0m\x1b[48;5;126m  \x1b[0m\x1b[48;5;127m  \x1b[0m
\x1b[48;5;128m  \x1b[0m\x1b[48;5;129m  \x1b[0m\x1b[48;5;130m  \x1b[0m\x1b[48;5;131m  \x1b[0m\x1b[48;5;132m  \x1b[0m\x1b[48;5;133m  \x1b[0m\x1b[48;5;134m  \x1b[0m\x1b[48;5;135m  \x1b[0m\x1b[48;5;136m  \x1b[0m\x1b[48;5;137m  \x1b[0m\x1b[48;5;138m  \x1b[0m\x1b[48;5;139m  \x1b[0m\x1b[48;5;140m  \x1b[0m\x1b[48;5;141m  \x1b[0m\x1b[48;5;142m  \x1b[0m\x1b[48;5;143m  \x1b[0m\x1b[48;5;144m  \x1b[0m\x1b[48;5;145m  \x1b[0m\x1b[48;5;146m  \x1b[0m\x1b[48;5;147m  \x1b[0m\x1b[48;5;148m  \x1b[0m\x1b[48;5;149m  \x1b[0m\x1b[48;5;150m  \x1b[0m\x1b[48;5;151m  \x1b[0m\x1b[48;5;152m  \x1b[0m\x1b[48;5;153m  \x1b[0m\x1b[48;5;154m  \x1b[0m\x1b[48;5;155m  \x1b[0m\x1b[48;5;156m  \x1b[0m\x1b[48;5;157m  \x1b[0m\x1b[48;5;158m  \x1b[0m\x1b[48;5;159m  \x1b[0m
\x1b[48;5;160m  \x1b[0m\x1b[48;5;161m  \x1b[0m\x1b[48;5;162m  \x1b[0m\x1b[48;5;163m  \x1b[0m\x1b[48;5;164m  \x1b[0m\x1b[48;5;165m  \x1b[0m\x1b[48;5;166m  \x1b[0m\x1b[48;5;167m  \x1b[0m\x1b[48;5;168m  \x1b[0m\x1b[48;5;169m  \x1b[0m\x1b[48;5;170m  \x1b[0m\x1b[48;5;171m  \x1b[0m\x1b[48;5;172m  \x1b[0m\x1b[48;5;173m  \x1b[0m\x1b[48;5;174m  \x1b[0m\x1b[48;5;175m  \x1b[0m\x1b[48;5;176m  \x1b[0m\x1b[48;5;177m  \x1b[0m\x1b[48;5;178m  \x1b[0m\x1b[48;5;179m  \x1b[0m\x1b[48;5;180m  \x1b[0m\x1b[48;5;181m  \x1b[0m\x1b[48;5;182m  \x1b[0m\x1b[48;5;183m  \x1b[0m\x1b[48;5;184m  \x1b[0m\x1b[48;5;185m  \x1b[0m\x1b[48;5;186m  \x1b[0m\x1b[48;5;187m  \x1b[0m\x1b[48;5;188m  \x1b[0m\x1b[48;5;189m  \x1b[0m\x1b[48;5;190m  \x1b[0m\x1b[48;5;191m  \x1b[0m
\x1b[48;5;192m  \x1b[0m\x1b[48;5;193m  \x1b[0m\x1b[48;5;194m  \x1b[0m\x1b[48;5;195m  \x1b[0m\x1b[48;5;196m  \x1b[0m\x1b[48;5;197m  \x1b[0m\x1b[48;5;198m  \x1b[0m\x1b[48;5;199m  \x1b[0m\x1b[48;5;200m  \x1b[0m\x1b[48;5;201m  \x1b[0m\x1b[48;5;202m  \x1b[0m\x1b[48;5;203m  \x1b[0m\x1b[48;5;204m  \x1b[0m\x1b[48;5;205m  \x1b[0m\x1b[48;5;206m  \x1b[0m\x1b[48;5;207m  \x1b[0m\x1b[48;5;208m  \x1b[0m\x1b[48;5;209m  \x1b[0m\x1b[48;5;210m  \x1b[0m\x1b[48;5;211m  \x1b[0m\x1b[48;5;212m  \x1b[0m\x1b[48;5;213m  \x1b[0m\x1b[48;5;214m  \x1b[0m\x1b[48;5;215m  \x1b[0m\x1b[48;5;216m  \x1b[0m\x1b[48;5;217m  \x1b[0m\x1b[48;5;218m  \x1b[0m\x1b[48;5;219m  \x1b[0m\x1b[48;5;220m  \x1b[0m\x1b[48;5;221m  \x1b[0m\x1b[48;5;222m  \x1b[0m\x1b[48;5;223m  \x1b[0m
\x1b[48;5;224m  \x1b[0m\x1b[48;5;225m  \x1b[0m\x1b[48;5;226m  \x1b[0m\x1b[48;5;227m  \x1b[0m\x1b[48;5;228m  \x1b[0m\x1b[48;5;229m  \x1b[0m\x1b[48;5;230m  \x1b[0m\x1b[48;5;231m  \x1b[0m\x1b[48;5;232m  \x1b[0m\x1b[48;5;233m  \x1b[0m\x1b[48;5;234m  \x1b[0m\x1b[48;5;235m  \x1b[0m\x1b[48;5;236m  \x1b[0m\x1b[48;5;237m  \x1b[0m\x1b[48;5;238m  \x1b[0m\x1b[48;5;239m  \x1b[0m\x1b[48;5;240m  \x1b[0m\x1b[48;5;241m  \x1b[0m\x1b[48;5;242m  \x1b[0m\x1b[48;5;243m  \x1b[0m\x1b[48;5;244m  \x1b[0m\x1b[48;5;245m  \x1b[0m\x1b[48;5;246m  \x1b[0m\x1b[48;5;247m  \x1b[0m\x1b[48;5;248m  \x1b[0m\x1b[48;5;249m  \x1b[0m\x1b[48;5;250m  \x1b[0m\x1b[48;5;251m  \x1b[0m\x1b[48;5;252m  \x1b[0m\x1b[48;5;253m  \x1b[0m\x1b[48;5;254m  \x1b[0m\x1b[48;5;255m  \x1b[0m

24-bit truecolor · SGR 48;2;R;G;B

Hue sweep 0° → 360° at full saturation + value, plus a 32-step grayscale ramp using per-channel RGB (not the 232–255 cube). A smooth gradient here proves the terminal supports per-pixel 24-bit colour; visible banding means it down-samples to the 256-palette.

rendered (browser)
raw bytes (\x1b literal form)
\x1b[48;2;255;0;0m  \x1b[0m\x1b[48;2;255;25;0m  \x1b[0m\x1b[48;2;255;51;0m  \x1b[0m\x1b[48;2;255;77;0m  \x1b[0m\x1b[48;2;255;102;0m  \x1b[0m\x1b[48;2;255;128;0m  \x1b[0m\x1b[48;2;255;153;0m  \x1b[0m\x1b[48;2;255;179;0m  \x1b[0m\x1b[48;2;255;204;0m  \x1b[0m\x1b[48;2;255;230;0m  \x1b[0m\x1b[48;2;255;255;0m  \x1b[0m\x1b[48;2;229;255;0m  \x1b[0m\x1b[48;2;204;255;0m  \x1b[0m\x1b[48;2;179;255;0m  \x1b[0m\x1b[48;2;153;255;0m  \x1b[0m\x1b[48;2;128;255;0m  \x1b[0m\x1b[48;2;102;255;0m  \x1b[0m\x1b[48;2;77;255;0m  \x1b[0m\x1b[48;2;51;255;0m  \x1b[0m\x1b[48;2;26;255;0m  \x1b[0m\x1b[48;2;0;255;0m  \x1b[0m\x1b[48;2;0;255;25m  \x1b[0m\x1b[48;2;0;255;51m  \x1b[0m\x1b[48;2;0;255;76m  \x1b[0m\x1b[48;2;0;255;102m  \x1b[0m\x1b[48;2;0;255;128m  \x1b[0m\x1b[48;2;0;255;153m  \x1b[0m\x1b[48;2;0;255;179m  \x1b[0m\x1b[48;2;0;255;204m  \x1b[0m\x1b[48;2;0;255;229m  \x1b[0m\x1b[48;2;0;255;255m  \x1b[0m\x1b[48;2;0;229;255m  \x1b[0m\x1b[48;2;0;204;255m  \x1b[0m\x1b[48;2;0;178;255m  \x1b[0m\x1b[48;2;0;153;255m  \x1b[0m\x1b[48;2;0;128;255m  \x1b[0m\x1b[48;2;0;102;255m  \x1b[0m\x1b[48;2;0;76;255m  \x1b[0m\x1b[48;2;0;51;255m  \x1b[0m\x1b[48;2;0;26;255m  \x1b[0m\x1b[48;2;0;0;255m  \x1b[0m\x1b[48;2;25;0;255m  \x1b[0m\x1b[48;2;51;0;255m  \x1b[0m\x1b[48;2;76;0;255m  \x1b[0m\x1b[48;2;102;0;255m  \x1b[0m\x1b[48;2;128;0;255m  \x1b[0m\x1b[48;2;153;0;255m  \x1b[0m\x1b[48;2;179;0;255m  \x1b[0m\x1b[48;2;204;0;255m  \x1b[0m\x1b[48;2;230;0;255m  \x1b[0m\x1b[48;2;255;0;255m  \x1b[0m\x1b[48;2;255;0;230m  \x1b[0m\x1b[48;2;255;0;204m  \x1b[0m\x1b[48;2;255;0;179m  \x1b[0m\x1b[48;2;255;0;153m  \x1b[0m\x1b[48;2;255;0;128m  \x1b[0m\x1b[48;2;255;0;102m  \x1b[0m\x1b[48;2;255;0;76m  \x1b[0m\x1b[48;2;255;0;51m  \x1b[0m\x1b[48;2;255;0;25m  \x1b[0m
\x1b[48;2;0;0;0m  \x1b[0m\x1b[48;2;8;8;8m  \x1b[0m\x1b[48;2;16;16;16m  \x1b[0m\x1b[48;2;25;25;25m  \x1b[0m\x1b[48;2;33;33;33m  \x1b[0m\x1b[48;2;41;41;41m  \x1b[0m\x1b[48;2;49;49;49m  \x1b[0m\x1b[48;2;58;58;58m  \x1b[0m\x1b[48;2;66;66;66m  \x1b[0m\x1b[48;2;74;74;74m  \x1b[0m\x1b[48;2;82;82;82m  \x1b[0m\x1b[48;2;90;90;90m  \x1b[0m\x1b[48;2;99;99;99m  \x1b[0m\x1b[48;2;107;107;107m  \x1b[0m\x1b[48;2;115;115;115m  \x1b[0m\x1b[48;2;123;123;123m  \x1b[0m\x1b[48;2;132;132;132m  \x1b[0m\x1b[48;2;140;140;140m  \x1b[0m\x1b[48;2;148;148;148m  \x1b[0m\x1b[48;2;156;156;156m  \x1b[0m\x1b[48;2;165;165;165m  \x1b[0m\x1b[48;2;173;173;173m  \x1b[0m\x1b[48;2;181;181;181m  \x1b[0m\x1b[48;2;189;189;189m  \x1b[0m\x1b[48;2;197;197;197m  \x1b[0m\x1b[48;2;206;206;206m  \x1b[0m\x1b[48;2;214;214;214m  \x1b[0m\x1b[48;2;222;222;222m  \x1b[0m\x1b[48;2;230;230;230m  \x1b[0m\x1b[48;2;239;239;239m  \x1b[0m\x1b[48;2;247;247;247m  \x1b[0m\x1b[48;2;255;255;255m  \x1b[0m

SGR text attributes · 1 / 2 / 3 / 4 / 5 / 7 / 9

Bold (1), dim (2), italic (3), underline (4), blink (5), reverse (7), strikethrough (9). Italic + strikethrough are xterm extensions that ECMA-48 never standardised — most modern terminals (kitty, alacritty, iTerm2, WezTerm, GNOME Terminal) support both; legacy BSD console and Windows conhost ignore them.

rendered (browser)
Bold Dim Italic Underline
Blink Reverse Strikethrough
bold + underline + red italic + reverse + yellow
raw bytes (\x1b literal form)
\x1b[1mBold\x1b[0m  \x1b[2mDim\x1b[0m  \x1b[3mItalic\x1b[0m  \x1b[4mUnderline\x1b[0m
\x1b[5mBlink\x1b[0m  \x1b[7mReverse\x1b[0m  \x1b[9mStrikethrough\x1b[0m
\x1b[1;4;31mbold + underline + red\x1b[0m   \x1b[3;7;33mitalic + reverse + yellow\x1b[0m

OSC 0 window title · ESC ]0;title ST

Sets the terminal emulator's window / tab title. No visible effect in the page body — look at your terminal's title bar after running the curl-piped script. xterm splits OSC 0 (icon name + window title) from OSC 1 (icon name only) and OSC 2 (window title only); modern terminals collapse all three to a single title.

Side effect lives on the host terminal (window title, cursor position, screen buffer) and cannot be shown in a browser preview. Run the curl-piped script to see it act.

raw bytes (\x1b literal form)
\x1b]0;ansicode test pattern\x1b\\

Interactive sequences · not auto-executed (would disrupt the script)

Cursor save/restore, alt-screen toggle, and cursor hide/show have legitimate uses (TUI apps, pagers, prompts) but firing them inside a curl-piped script would either no-op (save+restore on one line) or scramble the terminal (alt-screen entered then immediately exited). Try each manually with `printf` to see them work.

Side effect lives on the host terminal (window title, cursor position, screen buffer) and cannot be shown in a browser preview. Run the curl-piped script to see it act.

raw bytes (\x1b literal form)
DECSC / DECRC (save + restore cursor):    printf '\\033[s' ; printf 'AAA' ; printf '\\033[u'
Alt-screen on / off  (DEC mode 1049):     printf '\\033[?1049h' ; sleep 2 ; printf '\\033[?1049l'
Hide / show cursor   (DEC mode 25):       printf '\\033[?25l'  ; sleep 2 ; printf '\\033[?25h'
Bracketed-paste mode (DEC mode 2004):     printf '\\033[?2004h' ; cat ; printf '\\033[?2004l'

Adjacent pages on this site that go deeper on each subsystem the test pattern exercises.