How do I clean text from extra spaces and blank lines?
Paste text and toggle the options you need: trim spaces from line ends, collapse multiple spaces into one, remove blank lines, convert tabs to spaces (or vice versa), normalize line endings.
You see the result instantly. Perfect for cleaning text copied from PDFs, emails, or various apps, where whitespace chaos often creeps in.
How to use it
- Paste text in the input field.
- On the right, tick the cleaning options: whatever you want done to the output.
- Output updates live with each setting change.
- Below you see the character count before and after (how much you saved).
- Click "Copy" to grab the result.
When this is useful
Typical sources of messy text:
- Cleaning text copied from PDF: PDFs often insert extra spaces, weird characters, break words at strange places. Clean it all here.
- Email text: copying from Outlook or Gmail sometimes pastes invisible formatting and odd amounts of spaces.
- Pasted text from multiple sources: notes from various apps merged into one consistent document.
- Text files from different systems: line endings (CRLF on Windows, LF on Linux/macOS, CR on old Macs) differ across systems and can break applications. Normalize them all to one standard.
- Programming: preparing code for a commit: convert tabs to spaces (or vice versa), strip blank lines, clean line ends.
- Essays and school work: sometimes bad formatting introduces "double spaces" that mess up alignment. Fix in one click.
If you want to split text into lines and sort them, use our line sorter. To remove duplicate lines, see duplicate remover.