All Tools View Categories About Contact Privacy

ANSI Color Code Stripper

Turn terminal-colored logs back into clean plain text by removing every ANSI escape sequence.

Runs entirely in your browser — your logs never leave this page.
0
sequences removed
0
bytes before
0
bytes after
0
bytes saved

    

About ANSI Color Code Stripper

Terminal logs arrive with baggage. Run your service with Docker, capture it through “tee”, or save a session that was rendered to a screen, and the file is littered with ANSI escape sequences: “” and “” and “[0m” scattered between every line. To a human terminal they are invisible color and style; to everything else they are unparsable control bytes that break grep, defeat log shippers, corrupt CSV exports and make stack traces unreadable. ANSI Color Code Stripper removes them all in one pass, entirely inside your browser.

The tool matches the full family of ANSI sequences: CSI escapes that set foreground and background colors, styles such as bold, underline, blink and reverse, cursor-movement and screen-clearing codes, OSC sequences like window titles and terminal hyperlinks, and the shorter Fe escape forms terminals use for less common control functions. Real escape bytes — the actual ESC (0x1B) byte plus its parameters — are stripped; literal backslash text like “\033[31m” (six separate printable characters as they sit in a source file) is left completely untouched, so code samples or documentation that merely print escape-looking strings stay safe and are never mistaken for real control sequences.

Beyond stripping, the tool gives you two small but genuinely useful controls over the plain text you end up with. Preserve newlines is checked by default and keeps every original log line on its own line, and it also quietly normalizes Windows-style CRLF endings down to a single LF so downstream tools that split on a plain newline behave consistently. Uncheck it and the behavior changes meaningfully: every line break in the pasted text is replaced with a single space, flattening the whole paste into one continuous line — handy when colored output needs to go into a field, a URL, or a search box that cannot contain literal newlines. Collapse blank lines works independently of that choice: turn it on and any line that is empty after trimming is dropped from the result, tightening up logs where every other line is blank padding.

After stripping you get clean plain text, ready to grep, diff, archive, or feed to a parser that expects sane input. The stats report exactly how many sequences were removed and the byte savings before and after, calculated on real UTF-8 byte length rather than character count, so multi-byte characters in your log never skew the numbers. All processing is local and instant — nothing is ever sent over the network.

Features

  • CSI escape stripping — colors, styles, cursor and screen control sequences such as \x1b[31m and \x1b[2J.
  • OSC sequence stripping — window titles and terminal hyperlinks wrapped in \x1b] ... \x07.
  • Fe escape handling — shorter escape forms outside the CSI/OSC families are removed too.
  • Preserve newlines — keep one log line per line (and normalize CRLF to LF), or flatten the whole paste into a single line.
  • Collapse blanks — squeezes out runs of empty lines after stripping.
  • Summary stats — sequences removed and byte savings, measured in real UTF-8 bytes.
  • Copy / Download TXT / Print — take the clean log with you in whatever form you need next.
  • 100% local — nothing leaves the browser, no upload, no server round trip.

How to Use

  1. Paste your terminal log into the box, escape sequences and all — no need to clean anything up first.
  2. Choose options. Leave Preserve newlines checked to keep the original line structure, or uncheck it to flatten everything into one line; optionally turn on Collapse blank lines to drop empty lines from the result.
  3. Run. Every ANSI escape sequence is matched and stripped in one pass, and the count of sequences removed is tracked as it goes.
  4. Read the summary cards to see how many sequences were removed and the byte size before and after, confirming exactly how much control-byte overhead the file was carrying.
  5. Copy, download, or print the clean plain text and hand it to grep, a log shipper, a spreadsheet import, or a ticket.

Examples

Example 1 — Docker logs. “docker logs app | tee out.log” saves a file full of “” codes wrapping every message. Paste it here, strip, and grep for “ERROR” finally matches clean lines instead of silently missing everything because the pattern never lines up with the escape bytes in between.

Example 2 — CI output. A build log exported from a pipeline runner carries ANSI colors for pass/fail markers that a downstream parser cannot read; after stripping, the same log parses as plain text and feeds a dashboard or a test-result aggregator without choking on control bytes.

Example 3 — Stack traces. Terminal-colored exception output copied from a running process becomes readable plain text that can be pasted into a support ticket, a bug report, or a searchable archive without leftover color artifacts cluttering the view.

Example 4 — Single-line paste. A colored log needs to go into a form field that rejects newlines. Uncheck Preserve newlines before running and the entire multi-line capture collapses into one clean, space-joined line ready to paste.

Benefits

  • Parsable output — strip the control bytes, keep every visible character of content.
  • No false hits — literal escape-looking text in source or docs is never touched, only real ESC bytes are removed.
  • Size savings — drop the control byte overhead and see the exact byte count difference.
  • Flexible line handling — keep line structure or flatten to a single line, plus optional blank-line collapsing.
  • Instant — one click, fully local, no waiting on an upload.
  • Private — nothing leaves the browser, ever.

Frequently Asked Questions

What are ANSI color codes?
ANSI escape sequences are control characters terminals use to color and style text. In a raw file or paste they appear as garbled junk like “” or “[0;32m” that wrap every message. Logs captured with “tee”, from Docker, or from any terminal-run process are full of them.
What exactly is removed?
Every ANSI escape sequence, including the common CSI sequences that set foreground/background color, styles (bold, underline, blink, reverse), cursor movement and screen control (Escape sequences, ESC[ and OSC), plus their parameters. The text between the codes is preserved exactly.
Will I lose any real log content?
No. ANSI codes are control sequences, not content. Stripping them leaves every visible character, word and line intact — it only removes the invisible escape bytes. Your log becomes clean plain text ready for parsing or storage.
What if I want to keep some codes?
The tool always removes ANSI escape bytes — there is no option to keep specific colors. What you do control is line structure: leave Preserve newlines checked to keep one log line per line, or uncheck it to flatten the whole paste into a single line (useful when you need one long string). Collapse blank lines then squeezes out runs of empty lines from whichever result you chose. If a message contains a literal backslash-escape (two characters) it is left alone; only real escape bytes are removed.
How do I know how much was stripped?
The summary cards show the total escape sequences removed and the byte size before and after, so you can see exactly how much control noise the log contained.
Is my log uploaded anywhere?
No. Everything runs locally in your browser with no network requests.