# Terminal Output Cleaner > Strip ANSI escape codes, box-drawing characters, control sequences, and shell formatting from any copy-pasted terminal, TUI, or CLI output. Get clean plain text instantly. **Category:** Dev **Keywords:** terminal, output, cleaner, ANSI, escape codes, strip, remove, TUI, CLI, shell, control characters, color codes, box drawing, clean, plain text, sanitize, formatting, console **URL:** https://complete.tools/terminal-output-cleaner ## How it works The cleaner processes text through seven phases: **Phase 1 - Structural sequences:** Resolves backspace overprinting (used in man pages for bold and underline) and carriage return overwrites (used by progress bars that rewrite the same line). Normalizes line endings across platforms. **Phase 2 - ANSI escape sequences:** Strips CSI sequences (colors, cursor movement, erase commands), OSC sequences (window titles, terminal hyperlinks), DCS/PM/APC sequences, single-character escape sequences, and 8-bit C1 control codes. **Phase 3 - Visual artifacts:** Removes Unicode box-drawing characters (U+2500-U+257F), block elements and shade characters (U+2580-U+259F), braille patterns used for spinners (U+2800-U+28FF), geometric shapes (U+25A0-U+25FF), and other decorative indicators. **Phase 4 - Control characters:** Strips all non-printable control characters except newlines and tabs. **Phase 5 - Command flattening:** Optionally joins lines ending with backslash continuations into single commands. **Phase 6 - Line processing:** Trims whitespace, strips shell prompts ($, #, %, >), and normalizes multiple spaces to single spaces. **Phase 7 - Empty line handling:** Collapses consecutive blank lines to a configurable maximum. ## Who should use this - **Developers** copying terminal output into documentation, bug reports, pull request descriptions, or Slack messages - **DevOps engineers** extracting clean log data from terminal sessions for incident reports - **Technical writers** preparing command-line examples for documentation that need to be free of formatting artifacts - **Students and educators** sharing terminal output in assignments or teaching materials - **Anyone** who copies text from a terminal and gets garbage characters when pasting into a non-terminal application ## Common use cases **Cleaning CI/CD output:** Build logs from GitHub Actions, GitLab CI, or Jenkins often contain ANSI color codes that render as escape sequences when pasted into tickets or chat. **Sharing error messages:** Stack traces and error output from development servers frequently include color-coded formatting that becomes unreadable outside the terminal. **Documentation from man pages:** Man page output uses backspace overprinting for bold and underline, which produces doubled characters when pasted raw. **TUI application output:** Tools like htop, lazygit, k9s, and other TUI apps use extensive box-drawing and color formatting that needs stripping for plain text use. **Multi-line command cleanup:** Long commands split across multiple lines with backslash continuations can be flattened into single executable lines. ## Frequently asked questions **Does this modify my clipboard?** No. The tool only reads what you paste in and shows cleaned output. Your clipboard is not modified unless you explicitly click the Copy button on the result. **Will it strip actual content or just formatting?** The tool only removes formatting artifacts, control codes, and decorative characters. All meaningful text content is preserved. Shell prompt prefixes ($, #, %, >) are optionally stripped since they are not part of the actual command. **Does it work with Windows terminal output?** Yes. It handles Windows-style CRLF line endings and all standard ANSI escape sequences used by Windows Terminal, PowerShell, and WSL. **What about Unicode content in my output?** Regular Unicode text (letters, numbers, punctuation, CJK characters, etc.) is preserved. Only specific Unicode ranges known to be terminal formatting artifacts are removed, such as box-drawing and block element characters. --- *Generated from [complete.tools/terminal-output-cleaner](https://complete.tools/terminal-output-cleaner)*