Remove extra spaces

Collapse doubled spaces and tabs and tidy line ends the moment you paste.

Everything happens in your browser. Nothing you paste is uploaded or stored.

Where the extra spaces come from

Messy spacing rarely comes from careless typing alone. Text copied from PDFs and websites often carries doubled spaces, stray tabs and non-breaking spaces that look identical to normal ones but behave differently. Older writers were taught to put two spaces after every full stop, a habit from typewriter days that survives in plenty of documents. Spreadsheet exports pad columns with spaces to line things up, and deleting words while editing quietly leaves the gaps behind.

The result reads fine at a glance but causes real problems: duplicate detection fails because "John Smith" and "John  Smith" are different strings, mail merges print odd gaps, and word counts and searches misbehave. Paste the text here and every run of repeated whitespace collapses to a single space as you type, ready to copy back out.

Exactly what gets changed

  • Repeated spaces: any run of two or more becomes one.
  • Tabs: converted to a single space, including runs of tabs.
  • Non-breaking spaces: the invisible web-page kind, treated like ordinary spaces and collapsed.
  • Line ends: spaces and tabs at the start and end of every line are trimmed.
  • Blank lines: kept by default; tick the box to delete them and close the gaps.

Line breaks themselves are left exactly where they are, so your paragraphs and lists keep their shape. If the breaks are the problem rather than the spaces, the remove line breaks tool handles that side of the clean-up. Words, punctuation and capitalisation are never touched: the tool changes nothing but whitespace, so the cleaned text always says exactly what the original said. That predictability matters when you are tidying someone else's copy, because you can paste the result straight back without proofreading it all over again.

The   invoice   is  attached.
The invoice is attached. Three runs of repeated spaces collapsed to one each, taking the line from 29 characters to 24.
A five-line address block with two blank lines left over from editing.
With "Also remove blank lines" ticked: the three real lines pull together, blank lines gone, spacing inside each line tidied.

One space or two after a full stop?

One. On a typewriter every character occupied the same width, so typists added a second space to make sentence endings visible. Word processors and modern fonts space characters proportionally and handle sentence gaps on their own, which is why essentially every current style guide, from UK publishers to gov.uk, specifies a single space. Documents typed by two-space typists are one of the most common reasons people need this tool: a long report can hide hundreds of doubles, and find and replace only catches them one pattern at a time.

When not to use it

Indentation is spacing with a job. Code, especially Python where leading whitespace is part of the syntax, poetry laid out with deliberate spacing, and tab-separated data destined for a spreadsheet will all be damaged by trimming and collapsing. Keep this tool for prose, lists, addresses and copied text where the spacing is an accident of formatting rather than information. Nothing you paste leaves your browser, so it is safe to clean up drafts, client text and anything else you would not email to a stranger.

Frequently asked questions

Should there be one space or two after a full stop?

One. The two-space habit comes from typewriters, where every character was the same width and the extra gap helped sentences stand apart. Modern fonts space sentences properly on their own, and most style guides, including UK publishers and gov.uk, use a single space.

Does it remove tabs and non-breaking spaces?

Yes. Runs of ordinary spaces, tabs and non-breaking spaces (the invisible characters often copied from web pages) are all collapsed to a single ordinary space. That matters because a non-breaking space looks identical on screen but behaves differently in searches and comparisons.

Will it break my code or indentation?

It will remove it. Leading spaces are trimmed from every line, so indented code, especially Python where indentation is part of the syntax, should not go through this tool. It is designed for prose, lists and data where the spacing is accidental rather than meaningful.

What does the remove blank lines option do?

With the box ticked, any line that is empty, or contains only spaces and tabs, is deleted entirely, pulling the remaining lines together. Leave it unticked to keep your paragraph gaps and only tidy the spacing within lines.

Is my text uploaded anywhere?

No. The clean-up happens in your browser using JavaScript and the text never leaves your device. Refreshing the page clears everything.

Related tools