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 collapse spaces.
  3. Check the start of each line. A leftover single space is still there.
  4. Copy, and trim line ends only if that leftover space should go too.

What is Remove extra spaces?

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.”

Read more

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.

Use cases

  • A writer fixing a paragraph that picked up double spaces from a PDF.
  • A developer collapsing tab-aligned columns into something a search box can match.
  • An editor preparing alt text that was copied from a layout program.
  • A student cleaning a citation that used tabs between the author and the year.
  • Someone who still needs a leading indent and should trim only after checking.

Double spaces and a tab in one sentence

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.

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. Newlines are left alone. Only spaces and tabs inside the stream shrink to one space.