Whitespace remover
Transformed in your browser · nothing is uploaded
Two different jobs: collapsing runs of spaces to one and trimming each line, or removing every space, tab and line break so the text becomes a single unbroken string.
How to use the whitespace remover
Collapsing is what you want for prose: double spaces after full stops, trailing spaces at line ends, stray tabs from a paste. Removing everything is for data: a card number, a hash or a key that has picked up spaces from being wrapped across lines. Both matter more than they look, because trailing whitespace is invisible and is a common cause of a comparison failing when two values appear identical. Non-breaking spaces are worth a special mention: they are not matched by a plain space search, so a find-and-replace on " " leaves them behind. Both options here treat them as whitespace.
Questions
Collapse leaves single spaces between words. Remove all produces one unbroken string with no spaces at all.
Remove all does. Collapse turns tabs into spaces and keeps line breaks.
Probably a non-breaking space, which a plain space search does not find. Both options here catch it.
Yes, collapse reduces every run to a single space.
Often. It is invisible and makes two apparently identical values compare as different.