mytoolstash / text tools / text-cleaner

$ tr -s ' '

Text Cleaner

Fix text pasted from PDFs, emails, and websites — collapse spaces, unwrap lines, and strip junk characters.

Where messy text comes from

PDFs hard-wrap lines at the page width, so pasted paragraphs arrive full of stray line breaks. Word processors and websites add non-breaking spaces and zero-width characters that look invisible but break searches, diffs, and code.

Join broken lines, keep paragraphs

The line-joining option merges single line breaks into spaces while preserving blank-line paragraph boundaries — the standard fix for PDF-pasted text.