Formatting
Double spaces creep in from justified text, from a double tap, and from a column that was aligned with tabs. This page replaces every run of ordinary spaces and tabs with one space. Newlines are not spaces, so the line structure stays. “Odd socks\tin the dryer.” becomes “Odd socks in the dryer.”
The ends of a line are not a special case. A single leading space stays, because a run of length one is already collapsed. “A B\n C” becomes “A B\n C”: the gap inside the first line shrinks, and the single space before C remains. Trim is the tool that removes that leftover.
A sentence that already has single spaces does not change. “Odd socks in the dryer.” is the same sentence on the way out, period included. Non-breaking spaces, em spaces, and newlines are outside the pattern, so they are not folded into the single space.
Odd socks, then a tab, then two spaces, then in the dryer.
Odd socks in the dryer. The runs are one space each. The period stays. A newline in the source would still be a newline.
Oddsock runs this in your browser. It is free, it does not upload the work, and it does not ask for an account.
No. Newlines are left alone. Only spaces and tabs inside the stream shrink to one space.
A single space is already the collapsed form. Trim each line if the indent itself should disappear.
It is not an ordinary space or a tab, so it stays. The whitespace visualizer marks it with ⍽ so you can see it.
Only if that space was part of a longer run. “socks .” with one space stays “socks .” Two spaces before the period become one.
A run that contains a tab becomes one ordinary space. The tab character does not survive inside that run.