Converter Web ToolsConverter WebTools

ANSI Color Codes — Terminal Text Colors

ANSI escape codes add color and style to terminal output. The format is ESC[ + code + m (the ESC byte is \033 or \e). For example \e[31m turns text red and \e[0m resets it.

SGR codeEffect
0Reset all
1Bold
2Dim
3Italic
4Underline
7Reverse
30Black text
31Red text
32Green text
33Yellow text
34Blue text
35Magenta text
36Cyan text
37White text
90Bright black (gray)
91Bright red
40Black background
41Red background
42Green background
44Blue background
47White background

Example

echo -e "\e[1;32mSuccess\e[0m" prints Success in bold green.

Related tools & charts