ANSI Escape Code / Terminal Color Generator
Visually compose terminal text styling — FG/BG color in 16/256/24-bit truecolor, SGR styles (bold, faint, italic, underline, blink, inverse, hidden, strikethrough) — and get the exact ANSI escape sequence with a live preview. Multi-format escape output (\x1b, \033, \e, \u001b, raw ESC), language snippets (bash printf, Python, JS, Go, Rust, C), reverse decoder (paste a sequence → see what it does), hex→256 and hex→truecolor conversion, 256-color palette grid, strip-ANSI helper, terminal-support notes. 100% client-side.
About ANSI Escape Code / Terminal Color Generator
Visually compose terminal text styling — FG/BG color in 16/256/24-bit truecolor, SGR styles (bold, faint, italic, underline, blink, inverse, hidden, strikethrough) — and get the exact ANSI escape sequence with a live preview. Multi-format escape output (\x1b, \033, \e, \u001b, raw ESC), language snippets (bash printf, Python, JS, Go, Rust, C), reverse decoder (paste a sequence → see what it does), hex→256 and hex→truecolor conversion, 256-color palette grid, strip-ANSI helper, terminal-support notes. 100% client-side. Everything runs locally in your browser — your data never leaves your device.
How to use
- Enter your input in the tool above.
- Adjust any options to your preference.
- Use the Copy or Download buttons to save the result.
- Everything happens locally — your data never leaves your browser.
FAQ
What color modes does the generator support?
All four: (1) Standard 16-color (codes 30–37 / 40–47 foreground/background). (2) Bright 16-color (90–97 / 100–107). (3) 256-color cube (38;5;N / 48;5;N where N is 0–255, with 16 + 36r + 6g + b cube math and a 232–255 grayscale ramp). (4) 24-bit truecolor (38;2;r;g;b / 48;2;r;g;b). Plus every SGR style — bold, faint, italic, underline, blink, inverse, hidden, strikethrough.
Which escape sequence formats can I copy?
Five. The same SGR parameters can be rendered as \x1b[…m (JS/C/Go string), \033[…m (shell printf), \e[…m (bash echo -e), \u001b[…m (JS template literal / JSON), or a raw ESC character (0x1B). The tool always auto-appends \x1b[0m reset to avoid color bleed, and you can toggle showing a visible ^[ marker versus the literal escape.
Does it generate language-specific snippets?
Yes — copy-ready snippets for bash `printf` and `echo -e`, Python 3 (`print('\033[31m…')`), Node.js (`process.stdout.write`), Go (`fmt.Printf`), Rust (`print!` with `\x1b`), and C (`printf`). Each snippet wraps your sample text with the chosen escape and reset so it compiles and runs verbatim.
Can I decode an existing ANSI sequence?
Yes. Paste any string containing SGR escape codes (e.g. `\x1b[1;38;5;208mHello\x1b[0m`) and the reverse decoder lists every applied attribute — styles, foreground color (with mode + value), background color, and any resets. It also flags malformed sequences. A `strip ANSI` helper removes all escapes from a string.
What extra features does this tool have versus other ANSI generators?
(1) Four color modes (16, bright, 256, truecolor) with FG and BG pickers. (2) All 8 SGR styles as independent toggles. (3) Five escape-format renderings. (4) Language snippets for bash/Python/JS/Go/Rust/C. (5) Reverse decoder for pasted sequences. (6) hex→256 and hex→truecolor conversion with the canonical 16+36r+6g+b cube math. (7) 256-color palette grid with IDs. (8) Live terminal-style preview that honors the codes. (9) Strip-ANSI helper. (10) Terminal-support notes (truecolor/italic/blink caveats). (11) Reset auto-appended to prevent bleed. (12) Visible-^[ toggle. (13) Copy sequence / copy snippet / share URL. (14) History (localStorage, last 20). 100% client-side — nothing uploaded, no ads.
Related tools
.bashrc / .zshrc Alias & Config Manager
Build shell aliases, functions, exports, and PATH edits in a visual editor, then export a clean, commented .aliases file sourced from both .bashrc and .zshrc — with shadowing detection against shell builtins and common CLI tools, function suggestions when args are needed, starter packs (git, docker, kubectl, navigation, safety, ls, dev, devops, data science), import of existing rc files, dedupe, history (localStorage), and shareable URL. 100% client-side.
Add / Subtract Date Calculator
Add or subtract years, months, weeks, days, hours, minutes and seconds from a starting date/time. Calendar-day or business-day mode with custom weekend + holiday list. Month-end policy toggle (clamp to last day vs overflow). Repeat/series mode (e.g. every 2 weeks x 10) with CSV export. Shareable URL. 100% client-side.
Age Calculator
Calculate exact age from a birth date in calendar years/months/days (no negative-day bugs) plus totals in months/weeks/days/hours/minutes/seconds. Next-birthday countdown with weekday. Feb-29 birthday policy toggle. Milestones (1,000 days, 10,000 days, 1 billion seconds). Zodiac sign + Chinese zodiac. Age gap comparison. Shareable URL. 100% client-side.