Skip to main content

Terminal Color Picker

Click any color to see its ANSI code, escape sequence, and usage examples for bash, Python, and Node.js. Covers all 256 xterm colors.

✓ All 256 ANSI colors ✓ bash / Python / Node.js ✓ Foreground & background
Aa
Color 244 #808080
Foreground: ESC[38;5;244m
Background: ESC[48;5;244m
Reset: ESC[0m
Color #: 244
bash / sh
 
Python
 
Node.js
 
Preview mode:

Standard 16 Colors

Normal (0–7)
Bright (8–15)

256-Color Extended Palette

Colors 16–231 form a 6×6×6 RGB cube. Colors 232–255 are a grayscale ramp.

Frequently Asked Questions

What are ANSI escape codes?▼

ANSI escape codes are byte sequences that terminals interpret as commands rather than printable characters. They start with ESC (ASCII 27, written as \033, \x1b, or \e) followed by [ and a parameter list. For colors: \033[31m sets foreground red, \033[0m resets all attributes. They're standardized by ECMA-48 and supported by virtually every Unix terminal emulator.

What is the difference between 16, 256, and truecolor?▼

The 16 standard colors (codes 30–37, 90–97 for fg) are the oldest and most portable. 256-color mode (\033[38;5;Nm) adds a 6x6x6 color cube plus a 24-step grayscale ramp — supported by xterm, iTerm2, GNOME Terminal, and most modern terminals. Truecolor (\033[38;2;R;G;Bm) allows any 24-bit RGB value — supported by iTerm2, Kitty, Alacritty, Windows Terminal (v1.10+), and VS Code's integrated terminal.

How do I use ANSI colors in a bash script?▼

Define color variables at the top: RED='\033[31m' and RESET='\033[0m', then use them with echo -e or printf. Example: echo -e "${RED}Error: file not found${RESET}". Use printf for portability: printf '%b' "${RED}Error${RESET}\n". The -e flag tells echo to interpret escape sequences — without it, the literal characters \033 are printed.

How do I use terminal colors in Python?▼

You can use raw escape codes: print('\033[32mSuccess\033[0m'). For real projects, use the colorama library (pip install colorama) which handles Windows compatibility: from colorama import Fore, Style; print(Fore.GREEN + 'Success' + Style.RESET_ALL). For 256 colors: print('\033[38;5;208mOrange text\033[0m').

How do I use terminal colors in Node.js?▼

Raw escape codes work: console.log('\x1b[32mSuccess\x1b[0m'). The chalk library is the standard choice: const chalk = require('chalk'); console.log(chalk.green('Success')). Chalk auto-detects color support, respects NO_COLOR env var, and has a clean chaining API: chalk.bold.red('Error'). For 256 colors: chalk.ansi256(208)('Orange').

Why do colors look different in different terminals?▼

The 16 standard colors have no fixed RGB values — each terminal theme defines its own palette. What is 'red' (code 31) in one theme might be a deep maroon in another. 256-color and truecolor values are more consistent because they specify exact RGB. For maximum consistency across environments, use truecolor (\033[38;2;R;G;Bm) when you know the terminal supports it, or stick to the 256-color palette.

Share this tool: X / Twitter LinkedIn
✓ 60,000+ developers use DevPlaybook ★★★★★ 4.8 / 5 on Gumroad ✓ MIT licensed · Instant download ✓ No login required

Related Products

on Gumroad

You Might Also Need

More Free Tools

Enjoying this tool? Get more like it.

Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.

DevPlaybook Pro 7 days free

Unlock AI-Powered Dev Tools

  • ⚡ AI Code Review, Doc Generator & SQL Builder
  • ⚡ All premium templates & early access
  • ⚡ Member discounts on Gumroad products
Start Free Trial →

$9/mo after trial · Cancel anytime

Want the full toolkit?

Get DevPlaybook Pro

Every template, guide, boilerplate, and automation script in one bundle. 13 premium products — grab them all at once and save big.

$79
$241 separately Save $162 (67% off)
Get DevPlaybook Pro — $79 →

MIT licensed · Instant download · No subscription

See what's included → Browse all deals →