WordsPolish.
← All Tools

Remove Extra Spaces

Collapses double spaces and trims stray whitespace — including the hidden non-breaking-space gotcha.

This tool runs entirely in your browser. Nothing you type or paste here is ever sent to a server — see how the calculations work.

This collapses any run of multiple spaces down to a single space, and trims leading/trailing whitespace from each line. It's a small fix but a common one: text typed by two-space-after-period typists (a once-standard typewriter convention that most modern style guides, including AP and Chicago, have since moved away from in favor of a single space), or text pasted from a source with inconsistent spacing, ends up with visible extra gaps that look sloppy in final copy.

Cleaned-up text appears here as you type.

What actually gets cleaned, including the invisible character

Any run of two or more regular space characters in a row is collapsed to one. Leading and trailing whitespace on each line is trimmed, and (as an option) leading/trailing blank lines at the start and end of the whole document are trimmed too.

The less obvious fix this tool applies: pasted text — especially from Microsoft Word, Google Docs, or web pages — very often contains a non-breaking space (Unicode character U+00A0) instead of a regular space, typically inserted automatically around certain punctuation or by "smart" autoformatting. A non-breaking space looks visually identical to a normal space but is a different character under the hood, and it can cause subtle bugs: some word counters and search/replace tools don't recognize it as whitespace, so a phrase with a non-breaking space in it might not match a search you'd expect to find it, or a word count might come out different than expected. This tool normalizes non-breaking spaces to regular spaces as part of the cleanup.

Tabs are also normalized — converted to a single space by default, since a stray tab character copied from a spreadsheet or code editor often isn't intentional in prose text (if you're working with tab-separated data specifically, this tool isn't the right one — use it only on prose).

Who uses this

  • Cleaning up double-spaced-after-period text before pasting into a modern single-space-convention publication.
  • Fixing inconsistent spacing in text pasted from multiple sources (email threads, chat exports, old documents) before combining them.
  • Resolving a mysterious search-and-replace or word-count discrepancy that turns out to be caused by hidden non-breaking spaces.

Edge cases to know about

  • This tool does not touch line breaks — it only affects the horizontal whitespace within a line. Use /remove-line-breaks/ or /remove-empty-lines/ for line-level cleanup; this tool and those are meant to be used together on messy pasted text, not as substitutes for each other.
  • Code or data that intentionally uses multiple spaces for alignment (like a fixed-width table typed in plain text) will have that alignment destroyed by space-collapsing — this tool is meant for prose, not preformatted/monospace-aligned content.
  • If your text needs a non-breaking space to remain (for instance, deliberately preventing a line break between "10" and "km" in a specific rendering context), running it through this tool will remove that intentional behavior along with the accidental ones, since the tool can't distinguish intentional from accidental non-breaking spaces.

Related tools

FAQ

What is a non-breaking space and why does it matter?
It's a Unicode space character (U+00A0) that looks identical to a normal space but behaves differently — some tools don't count it as whitespace for word-splitting, search, or replace purposes. It commonly ends up in text pasted from Word, Google Docs, or web pages via autoformatting. This tool converts it to a regular space so downstream counting and search tools behave as expected.
Will this remove intentional double spaces after periods?
Yes, by design — the tool collapses any run of multiple spaces to one, regardless of where they occur. If your specific style guide or publication requires the older two-spaces-after-a-period convention, don't run the text through this tool, or add the extra space back manually afterward.
Does this fix spacing inside a table or code block?
No — it's built for prose. Multi-space alignment in a plain-text table or preformatted code block will be collapsed along with genuine accidental extra spaces, which will break the alignment. Don't run tabular or code content through this tool.