ANSI Escape Code Remover
Strip ANSI colour and terminal control sequences from pasted logs so the text reads cleanly.
What this page does
Terminal output carries invisible escape sequences for colour and cursor movement; this page removes them and leaves the readable text.
How to use it
Paste or type the text and press Run. The result appears beside the form. With "\u{1b}[31merror\u{1b}[0m: build failed\n\u{1b}[1;33mwarning\u{1b}[0m: deprecated flag", the page gives:
error: build failed
warning: deprecated flag
The rule it applies
Three sequence families are removed: OSC sequences ending in BEL or ST, CSI sequences that start with ESC [ and end at a letter, and two-character ESC sequences. Everything else is copied through unchanged.
The visible characters are copied through in order; only escape sequences are removed. Every character is read in your browser: nothing is uploaded and nothing is stored.
Terminal output carries invisible escape sequences for colour and cursor movement; this page removes them and leaves the readable text.
The rule this page applies: Three sequence families are removed: OSC sequences ending in BEL or ST, CSI sequences that start with ESC [ and end at a letter, and two-character ESC sequences. Everything else is copied through unchanged.
Worked example: "\u001b[31merror\u001b[0m: build failed\n\u001b[1;33mwarning\u001b[0m: deprecated flag" gives the output recorded in the example below, character for character.
How to use the ANSI Escape Code Remover
Paste or type the text into the box and press Run. The result appears beside the form, and pressing Run again re-reads whatever is in the box.
This page has nothing to configure: it reads the text and applies the rule below. [31merror[0m: build failed [1;33mwarning[0m: deprecated flag
The rule this page applies
Three sequence families are removed: OSC sequences ending in BEL or ST, CSI sequences that start with ESC [ and end at a letter, and two-character ESC sequences. Everything else is copied through unchanged.
The visible characters are copied through in order; only escape sequences are removed.
What to Expect
Best for
- Pasting coloured build logs into an issue
- Turning terminal output into plain text
Not ideal for
- Rendering colour, which needs a terminal
- Binary output that is not text
What this tool keeps
- The text exactly as you pasted it
- The same answer on every run
- Nothing sent, stored or logged
What may need cleanup
- A marker such as [email] or [url] that you want spelled differently
- Spacing carried over from the text you pasted
Common errors
- An all-whitespace input is refused, because there is nothing to clean.
- An empty box, which the page refuses rather than printing a blank result
Example use cases
- Cleaning CI logs for a bug report
- Archiving terminal sessions as text
Sample input
[31merror[0m: build failed [1;33mwarning[0m: deprecated flag
Sample output
error: build failed warning: deprecated flag
Who this is for
- developers
- support engineers
Frequently asked questions
What rule does this page apply?
Three sequence families are removed: OSC sequences ending in BEL or ST, CSI sequences that start with ESC [ and end at a letter, and two-character ESC sequences. Everything else is copied through unchanged.
What input does it refuse?
An all-whitespace input is refused, because there is nothing to clean.
What is left unchanged?
The visible characters are copied through in order; only escape sequences are removed.
Is anything uploaded?
No. The text is read by JavaScript in this page and nothing is posted, stored or logged.
Build custom tools for your store
Join the SDK program to create useful ecommerce utilities for your store.