Strip ANSI Codes
Remove ANSI escape and color codes from terminal output and logs — paste your raw output, get clean readable text. Runs entirely in your browser, no server, no sign-up.
What this tool does
Paste terminal output, a build log, or any text peppered with ANSI escape codes,
and get back clean, readable plain text. Those [31m, [0m, and [2K
sequences your shell uses to paint colors and move the cursor get stripped out —
right in your browser. Nothing is uploaded to a server, it works offline, and it
needs no sign-up.
What are ANSI codes?
Terminals color and format text with ANSI escape sequences — short control
strings that start with the escape character (ESC, shown as \x1b or ^[).
The most common are SGR codes for color and style (\x1b[31m = red,
\x1b[1m = bold, \x1b[0m = reset). Others move the cursor or erase parts of the
screen (\x1b[2J, \x1b[H), or set the window title and clickable links
(OSC strings). When you copy colored output into a file or a ticket, those
codes come along as visual noise — this tool removes them.
Strip modes
| Strip | What it removes | What it keeps |
|---|---|---|
| all (default) | Every ANSI escape sequence — colors, styles, cursor moves, screen-erase, and OSC titles/hyperlinks | Plain text, Unicode, and line breaks |
| color | Only SGR color and style codes (\x1b[…m) | Cursor and erase control sequences stay intact |
Use all to get clean copy-pasteable text. Use color when you want to drop the coloring but preserve cursor/erase control — for example, feeding output to a program that still relies on the positioning codes.
Examples
| Input | Strip | Output |
|---|---|---|
\x1b[1;32m✓ build passed\x1b[0m | all | ✓ build passed |
\x1b[31mERROR\x1b[0m: not found | all | ERROR: not found |
\x1b[2J\x1b[H\x1b[33mwarn\x1b[0m | color | \x1b[2J\x1b[H + warn |
\x1b]8;;https://x.com\x1b\\link\x1b]8;;\x1b\\ | all | link |
Common uses
- Clean up CI / build logs copied from GitHub Actions, GitLab, or Jenkins before pasting them into an issue.
- Strip color from
grep --color,ls,npm,cargo, orpytestoutput redirected to a file. - Make a diff or test failure readable in a plain-text editor or chat.
- Pre-process logs so a search, a script, or an LLM sees the text without escape noise.
FAQ
Is it free and private?
Yes — your input never leaves your device, and it keeps working offline once the page has loaded.
Does it keep my Unicode and line breaks?
Yes. Only the ANSI escape sequences are removed; accents, emoji, tabs, and newlines are preserved exactly.
What's the difference between "all" and "color"?
all removes every escape sequence for fully clean text. color removes only the SGR color/style codes and leaves cursor-movement and screen-erase sequences in place.
Does it handle OSC hyperlinks and window titles?
Yes — in all mode, OSC
strings (terminated by BEL or ST) such as \x1b]8 hyperlinks and \x1b]0 window
titles are removed, leaving just the visible link text.
Why are there still odd characters left?
This tool removes ANSI/VT escape sequences. Truly raw control bytes that aren't part of an escape sequence (for example a stray backspace used for overstrike) are left as-is.
Developer & Automation Access
Run it from the terminal
Same engine as this page, headless — via the gizza CLI:
gizza tool strip-ansi-codes '\u001b[1;32m✓ build passed\u001b[0m'New to the CLI? Get gizza →
Open it by URL
Pre-fill and auto-run this tool with query parameters — the names match the API/CLI:
https://gizza.ai/tools/strip-ansi-codes/?text=%5Cu001b%5B1%3B32m%E2%9C%93%20build%20passed%5Cu001b%5B0m&scope=allMachine-readable descriptor: tool.json — title + parameters JSON Schema for agents.
