Remove double spaces from text
Turn runs of spaces into a single space: too many spaces becomes too many spaces. The cleaning happens in your browser and nothing is uploaded.
How it works
-
Paste your text
Type or paste the text in the left box, or open a .txt file. No text to hand? Click Example.
-
Instant result
The result appears as you type. Change the options and see straight away what changes.
-
Copy or download
Copy the result with one click, save it as a file or use it as input for a next step.
Example
This sentence has too many spaces. followed by And these tabs too. becomes This sentence has too many spaces. and And these tabs too. The note under the result says how many places were cleaned up, here 6.
Where double spaces come from
- Text copied from a PDF, where the justification leaves wide gaps.
- Old habits of typing two spaces after a full stop.
- Exports and templates that pad fields with spaces.
- Merged text, where one part ends with a space and the next starts with one.
Two options
- Treat tabs and hard spaces as spaces is on by default, because they look like spaces but are different characters.
- Remove spaces at the start and end of lines trims each line.
To remove all spaces, use remove whitespace. For a complete clean-up of spaces, tabs and blank lines at once, use normalize whitespace.
Frequently asked questions
Does it remove line breaks?
No. Only runs of spaces within a line change; every line break stays. For blank lines use [remove empty lines](/en/text/remove-empty-lines), and for everything at once [normalize whitespace](/en/text/normalize-whitespace).
What about spaces at the start and end of lines?
With *Remove spaces at the start and end of lines* ticked, the default, they are trimmed. Untick it to keep the indentation of each line.
Are tabs and non-breaking spaces treated as spaces?
With *Treat tabs and hard spaces as spaces* ticked, a run of any of them becomes a single space. Untick it to collapse plain spaces only.
Is the double space after a full stop something to remove?
Many style guides today prefer a single space after a full stop, and web pages show only one anyway. The tool removes the extra space everywhere.