Skip to content
OddsockLocal
Local
Source text

Formatting

5 wordsRuns in this browser. Nothing is uploaded.

How to use

  1. Paste the text.
  2. Leave the operation on trim.
  3. Look for lines that became empty. They were only whitespace and are still present.
  4. Copy, then remove empty lines if those leftovers should go.

What is Trim whitespace?

Indents from a PDF, a code block, or a copied table sit at the ends of lines and break equality checks. Trim walks each line and removes ordinary spaces and tabs from both ends. The middle of the line is untouched. “ Odd socks ” and “ in the dryer. ” become “Odd socks” and “in the dryer.”

Read more

A line that was only spaces becomes an empty line and stays in the list. Trim does not delete it. Remove empty lines does. A double space between words stays a double space. Collapse spaces is the operation that shrinks that run. A Windows carriage return is treated as a line break, so the padding before it is still trimmed.

“Odd socks in the dryer.” has no padding, so the result is the same sentence, period included. Trim uses Unicode whitespace, so a non-breaking space or an em space at either end goes too. A zero-width space is not whitespace and can sit there after the line looks clean. Collapse spaces is stricter in the other direction: it only shrinks ordinary spaces and tabs, and it leaves a non-breaking space in the middle of a line.

Use cases

  • A developer comparing two lists that differed only by a trailing space.
  • A data clerk cleaning a column pasted from a spreadsheet.
  • An editor removing the indent a quote picked up from an email.
  • A student preparing one sentence per line for a line count.
  • Someone who collapsed interior spaces already and still has padding on the ends.

Two padded lines from a copy

A line “ Odd socks ” and a line “ in the dryer. ”, including the spaces at both ends.

Odd socks in the dryer. Interior spaces were already single, so they look the same. Only the ends changed.

Why use Oddsock

Oddsock runs this in your browser. It is free, it does not upload the work, and it does not ask for an account.

Related tools

Using this tool

No. Trim only removes the ends. “Odd socks” stays “Odd socks”. Collapse spaces does the interior.