ANSI Terminal Color Code Generator
Guide
ANSI Terminal Color Code Generator
Build ANSI escape sequences (Select Graphic Rendition codes) for coloring and styling terminal output. Pick a foreground and background color, toggle styles like bold or underline, and get a ready-to-paste escape string plus a live preview of how it renders in a terminal.
Comment utiliser
- Type the sample text you want to style in the Sample Text field (for example,
Error: file not found). - Choisissez un Color Mode: Basic (16 colors) for maximum compatibility, 256-color for richer palettes, or True color (24-bit RGB) for any hex color.
- Pick a foreground and (optionally) background color. Toggle text styles such as bold, italic, underline, or blink.
- Select the Escape Prefix that matches your language:
\033[(C / Python),\x1b[(Node), or\e[(bash). - Copy the escape string, the wrapped sample (escape + text + reset), or the ready-made Python / Node / Bash snippet.
Caractéristiques
- Three color modes – 16-color SGR (30-37 / 90-97 / 40-47 / 100-107), xterm 256-color palette (38;5;N / 48;5;N), and 24-bit true-color (38;2;R;G;B / 48;2;R;G;B).
- Full style coverage – Bold (1), Dim (2), Italic (3), Underline (4), Blink (5), Reverse video (7), and Strikethrough (9).
- Live terminal preview – Renders the styled text in a dark terminal pane so you can see the result before pasting it anywhere.
- Multiple escape formats – Pick between
\033[,\x1b[,\e[, or a raw ESC byte to match the language or shell you are targeting. - Copy-ready code snippets – Auto-generated
print(),console.log()etprintfexamples that wrap your sample text with the chosen escape and a trailing reset. - Active SGR badges – A summary of every SGR parameter currently active, including the human-readable color name and the numeric code.
FAQ
-
What is an ANSI escape sequence?
An ANSI escape sequence is a special string that starts with the ESC control character (0x1B) and is recognized by terminal emulators as a command rather than printable text. The most common form is the Control Sequence Introducer (CSI), written as ESC followed by an open bracket, which is used to move the cursor, clear parts of the screen, and most relevantly here, change text colors and styles through Select Graphic Rendition (SGR) parameters.
-
What does SGR stand for in ANSI codes?
SGR stands for Select Graphic Rendition. It is the subset of ANSI CSI sequences that ends with the letter m and carries one or more numeric parameters that control display attributes such as foreground color, background color, boldness, italics, underline, and blink. SGR codes were standardized in ECMA-48 and ISO/IEC 6429.
-
Why are there three different color modes?
Terminals evolved over time. The original VT100 family supported only eight colors plus eight bright variants, which became the 16-color SGR range (30 to 37, 90 to 97 for foreground). xterm later introduced an indexed 256-color palette accessed with 38;5;N. Modern terminals can address any RGB color using 38;2;R;G;B, often called true-color or 24-bit color. Each mode trades capability for backward compatibility.
-
What does a reset code do?
The reset sequence, written as ESC [ 0 m, clears every previously set SGR attribute and returns the terminal to its default foreground color, default background color, and default text styles. Without a trailing reset, the chosen color or style would continue to apply to whatever text the program prints next, which is rarely desired.
-
Why do some terminals ignore the blink code?
Blinking text (SGR code 5) is technically part of the standard, but most modern terminal emulators either render it as bold, render it without animation, or ignore it entirely. The behaviour depends on the emulator and on user accessibility preferences, since flashing text can trigger discomfort or seizures. Tools that need to attract attention typically rely on reverse video or bright colors instead.
Installez nos extensions
Ajoutez des outils IO à votre navigateur préféré pour un accès instantané et une recherche plus rapide
恵 Le Tableau de Bord Est Arrivé !
Tableau de Bord est une façon amusante de suivre vos jeux, toutes les données sont stockées dans votre navigateur. D'autres fonctionnalités arrivent bientôt !
Outils essentiels
Tout voir Nouveautés
Tout voirMise à jour: Notre dernier outil was added on Mai 25, 2026
