About Trim Whitespace
Indented pastes, padded spreadsheet cells and code copied from a chat often carry spaces or tabs at the edges of each line. They are invisible on screen but break lookups, comparisons and imports.
This trims both ends of every line, including non-breaking and full-width spaces, and leaves the space between words exactly as it was. Empty lines stay where they are.
How it works
- The text is split into lines at any kind of line break, and the ending used in the input is used again in the output.
- Clean-ups run in this order: non-printing characters, trimming, collapsing spaces, empty lines, duplicates, and finally the line order.
- Duplicates are compared after the earlier steps, keeping the first occurrence. Accented letters typed in different ways count as the same.
- Sorting uses your browser language rules, so accented letters sort next to their base letter. Shuffling uses the browser secure random generator.
Questions
Does it change the spaces between words?
No. Only spaces and tabs at the very start and very end of a line are removed. Turn on "Collapse repeated spaces" if you also want double spaces inside lines reduced to one.
Which kinds of space count?
Ordinary spaces, tabs, non-breaking spaces, full-width ideographic spaces, the other Unicode space characters and a stray byte-order mark.
Everything you enter here is processed in this browser tab. Nothing is uploaded, logged or shared. How privacy works here.