What the tool changes
This cleaner applies three rules to the whole input in a single pass. Every run of spaces and tabs becomes one space. Every run of three or more line breaks collapses to a single blank line. Leading and trailing whitespace at the start and end of the text is trimmed. Nothing else is touched: letters, digits and punctuation are left exactly as they arrived.
It is a tidy-up, not a strip-everything operation. The single spaces between words survive because they separate words, and paragraph breaks survive because they separate blocks. What disappears is the padding that copying tends to collect, especially from PDFs, email clients and tables pasted out of spreadsheets.
When it earns its place
Pasted web copy is the common case. Text copied from a rendered page often carries non-breaking characters and ragged line ends, which then break search-and-replace, form validation or a diff against the source. Running the text through this page first gives you one space where a human would expect one space, and one blank line between paragraphs.
It is also useful before comparing two strings. Two blocks that look identical on screen can differ by a trailing tab, and an equality check will fail for a reason no one can see. Because the rules are fixed and applied in one pass, the output is stable: converting the result a second time returns the same text, so the tool is safe to run repeatedly in a pipeline.
Worked example
Take a caption pasted from a PDF that reads, on three lines, the word Name, a colon, four spaces, the word John, then a line holding only three spaces, then a line with the word Smith and two trailing spaces. After conversion the padding between the colon and the first name is a single space, and the two trailing spaces at the very end of the string are gone. The line that held only spaces becomes a line holding a single space: it is not deleted, because it is still a line with content from the tool's point of view.
Note what the trim rule does and does not do. It trims the beginning and end of the whole text, not each line separately, so a line that ended in padding can keep one trailing space before its line break. Two line breaks in a row are also left alone, since only runs of three or more are collapsed, so a single blank line survives as intentional spacing. If your downstream system is strict about trailing spaces per line, check the output in an editor that shows whitespace before you commit it.
Limits and edge cases
Non-breaking spaces are not matched by the space-and-tab rule, so text pasted from a website or a word processor can keep invisible gaps that look like ordinary spaces but behave differently in HTML and in search. A run of two line breaks is also left alone: only three or more collapse, on the assumption that one blank line is intentional spacing between paragraphs.
The tool does not remove all spaces, so it cannot produce a single unbroken token. It also does not re-indent code, and running it on source files will flatten the indentation that gives the code its structure. For reordering the cleaned lines alphabetically, use the line sorter next; for a word total on the result, the word counter; and for changing capitalisation without touching spacing, the case converter.
