How this works in your browser
Each rule is a separate transformation applied only if you enable it, which is why they are independent toggles rather than one clean-up button. Trimming removes leading and trailing whitespace per line, space collapsing reduces runs of spaces and tabs to one, blank-line collapsing reduces consecutive empty lines to a single break, and flattening replaces every whitespace character including line breaks with a single space. Keeping them separate matters because the right combination differs completely between prose and code: trimming rescues a PDF paste and destroys code indentation, so the choice has to stay yours.
Who uses Whitespace and Line-Break Trimmer
Fixing PDF copy-paste
Repair paragraphs shattered into fragments by copying from a PDF.
Cleaning up email text
Remove quote artefacts and irregular spacing from forwarded messages.
Preparing text for import
Normalise whitespace before pasting into a system that is fussy about it.
Tidying pasted content
Strip inconsistent spacing picked up from another application.
Frequently asked questions
Can I choose which cleanup rules to apply?
Yes, each rule (trim lines, collapse spaces, collapse blank lines, flatten to one line) can be toggled independently.
What does "flatten into one line" do?
It replaces all whitespace (including line breaks) with single spaces, useful when you need a single-line version of multi-line text.
Does it remove tabs?
Yes, tabs are treated the same as spaces when collapsing repeated whitespace.
Why does text copied from a PDF break so badly?
Because a PDF stores positioned text rather than flowing paragraphs, so copying inserts a line break wherever a line ended on the page. The result is a paragraph shattered into fragments. Flattening to one line and then reinstating real paragraph breaks is the fastest way to recover it.
Which options should I turn on?
For PDF or email text, trim lines and collapse blank lines first, then flatten if the paragraph is still broken. For code or structured content, use trimming and space collapsing only, since flattening would destroy the structure entirely.
Will this remove indentation from code?
Yes, if you enable line trimming, which strips leading whitespace along with trailing. That is exactly what you want for prose and exactly what you do not want for code. Use space collapsing alone if the indentation matters.
Is my text uploaded anywhere?
No. The cleanup runs entirely in your browser.