Clean up messy whitespace: trim lines, collapse spaces, remove blank lines and line breaks.
How to use the Whitespace Remover
Paste text, for example copied from a PDF.
Pick the cleanup options you need.
Copy the tidied result.
This is a whitespace cleaner for text that arrived messy, the kind you get when copying from a PDF, an email or a document, where stray line breaks, double spaces and blank lines are common.
It gives you a set of options you can combine: trim spaces from the ends of lines, collapse runs of spaces into one, remove blank lines, join everything onto a single line, or strip all whitespace entirely.
Everything runs in your browser, so your text never leaves your device.
The problem it solves most often is pasting from a PDF, which stores text with fixed line breaks and padding for layout. The result usually has line breaks in the middle of sentences and doubled spaces, which this tidies up.
Collapsing spaces replaces multiple spaces or tabs with a single space without touching line breaks, while removing blank lines drops the empty rows that pile up between paragraphs.
To turn broken lines back into flowing paragraphs, join them onto one line. To get a single continuous string with no spacing at all, remove all whitespace, which overrides the other options.
Frequently asked questions
PDFs store text with fixed line breaks and padding for layout, so copied text often has line breaks mid-sentence and double spaces. This tool removes them.
It replaces runs of multiple spaces or tabs with a single space, without touching line breaks.
It strips every space, tab and line break, leaving one continuous string. It overrides the other options.
Use the option to join everything onto one line, which removes the line breaks so the text flows as a single paragraph.
No. The cleanup runs entirely in your browser, so nothing you paste leaves your device.
Embed this tool
Add this tool to your own website. Copy the snippet below; it stays up to date automatically.
<iframe src="https://monu.tools/embed/en/whitespace-remover" width="100%" height="640" style="border:1px solid #e5e5e5;border-radius:12px;max-width:680px" loading="lazy" title="Monu Tools"></iframe>Related tools
Turn any title into a clean, SEO-friendly URL slug, with German umlaut handling.
Convert numbers to Roman numerals and Roman numerals back to numbers (1 to 3999).
Sort lines of text alphabetically, numerically or by length, with options to trim, deduplicate blanks and ignore case.
Translate text to Morse code and Morse code back to text, using the international standard.