Terminal Color Code Reference
The Terminal Color Code Reference helps you find ANSI color codes, escape sequences, and text formatting options for command-line interfaces. Search by name, code, or escape sequence to quickly identify the formatting you need.
Look up a terminal color code
Selected code
ANSI terminal color codes
| Code | Name | Category | Escape sequence | Example |
|---|
Examples use VS Code's default dark terminal colors; every terminal theme shows them a little differently.
What Is a Terminal Color Code Reference?
A terminal color code reference is a lookup guide for ANSI escape sequences used to format text in terminals and command-line applications. These codes can change text colors, apply styles such as bold or underline, and reset formatting to normal.
Developers use terminal color codes in Linux shells, scripts, logs, and CLI tools to make output easier to read. ANSI sequences typically begin with an escape character and use control codes to apply formatting.
How to Use the Terminal Color Code Reference
Search Color Codes: Enter a color or style name, numeric code, or escape sequence in the search field.
Choose a Category: Select a category or choose All Codes to browse the available options.
Select Escape Format: Choose ANSI to view codes in the supported escape format.
Review the Results: Check each code's name, category, numeric value, escape sequence, and example.
Find the Required Sequence: Use the matching escape sequence in your terminal command or script.
Example: Using ANSI Terminal Color Codes
ANSI escape sequences can style terminal text.
For example, the following Bash command prints a message in red and then resets the formatting:
printf '\033[31mThis text is red\033[0m\n'
\033[31m applies red foreground text in terminals that support ANSI colors.
This text is red is the message being displayed.
\033[0m resets the formatting to the terminal's default style.
Text-style codes work similarly. For example, \033[1m enables bold text, while \033[4m enables underlining. Support and appearance can vary by terminal.