What this tool does
Terminal Output Cleaner takes messy copy-pasted output from any terminal emulator, TUI application, or command-line tool and converts it to clean plain text. When you copy text from a terminal, it often carries invisible ANSI escape sequences, box-drawing characters used for borders and tables, braille spinner frames, progress bar block elements, and other formatting artifacts that make the text unusable in documents, emails, or code comments. This tool strips all of that in one pass, leaving only the meaningful content.
It handles output from iTerm2, Terminal.app, Windows Terminal, Alacritty, kitty, tmux, screen, and any other terminal emulator. It also cleans output from TUI frameworks like bubbletea, blessed, ink, and rich.
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.
Explore Similar Tools
Explore more tools like this one:
- Claude Code Cleaner — Clean up messy terminal output. Strips ANSI escape... - Terminal Velocity Calculator — Calculate terminal velocity of a falling object based on... - Text Cleaner — Remove junk characters, extra spaces, line breaks, and... - Plain Text Converter — Strip all Unicode styling and special characters to... - Remove Blank Lines — Strip empty and whitespace-only lines from text