ANSI Escape Stripper

← All tools

Paste a terminal log and remove CSI colors, OSC hyperlinks, and other ECMA-48 escapes. Newlines and the rest of the text stay.

The log never leaves the browser. Nothing is uploaded, and the log is not stored in the URL.

Open file…

Only 7-bit ESC sequences are removed. Bytes in the C1 range stay, because they are also UTF-8 continuation bytes. Files up to 1 MB open in the page. The page stops at 1,000,000 characters.

Not stripped

Plain text

Copy and Download use this summary, counts included.

About this tool

A terminal colors text by writing an ESC byte, U+001B, then a sequence. CSI starts with ESC [. Parameter bytes, then intermediate bytes, then one final byte from @ to~. SGR color is a CSI sequence whose final byte ism. This page removes the whole sequence, not only color.

OSC starts with ESC ]. OSC 8 is the hyperlink form: the URL sits inside the sequence, and the visible label sits after it. The sequence ends at BEL or at ST, which is ESC \. DCS, SOS, PM, and APC are the same shape with a different introducer. A charset designation such as ESC ( B is removed too.

A sequence that runs off the end of the log is removed, and the page says it was unfinished. A CSI that is cut by a byte that cannot be a final is left in the text, so you can see the break. Bytes0x80 to 0x9F are not treated as C1 controls. In UTF-8 those values are continuation bytes, and stripping them would corrupt characters such as é.

Read more

Free books, courses, and software

Get my programming books, course editions, and complete software.

Get the download library →