Writing · 9 November 2026

Cleaning Up Copy-Pasted Text: Spaces, Line Breaks and Duplicates

Fix the mess that appears when you paste from PDFs, emails or spreadsheets, using a few simple text tools.

Text copied from a PDF or an email often arrives with strange line breaks, double spaces and repeated lines. Fixing it by hand takes ages, and a few small tools do it in seconds.

Double spaces

Extra spaces creep in from scans and old documents. The extra space remover turns them into single ones and trims the ends of lines.

Broken lines from PDFs

PDFs break lines in the middle of a sentence. The line break remover joins them into proper paragraphs. If you want to keep paragraphs, choose the option to keep blank lines.

Blank lines

Use remove empty lines when a list has gaps in it.

Duplicate lines

A mailing list, a keyword list or a set of URLs often has repeats. Remove duplicate lines keeps the first occurrence and drops the rest. Check the case option, because "Apple" and "apple" may or may not count as the same.

Bulk edits

To change a word everywhere, use find and replace. It also supports patterns, which is handy for tidying phone numbers or dates.

Order matters

Sorting is a good last step. Sorting by length brings the odd short or very long lines to the top so you can spot errors.

All of this happens in the browser, so you can clean private documents without sending them anywhere.

Tools mentioned in this article