Remove extra spaces
Clean up double spaces and stray whitespace.
Editor
Remove extra spaces: what it does
Collapse repeated spaces into one, trim the whitespace at the start and end of each line, or strip every space and tab. It cleans up pasted text, exports and copy from web pages in one step.
Remove extra spaces: how to use it
- Paste the text with extra spaces.
- Choose the tool: remove extra spaces, trim lines, or remove all spaces.
- Select Apply and copy the clean text.
Remove extra spaces: when to use it
- Clean text copied from a PDF, a scan or a chat where words are separated by several spaces.
- Trim the spaces at the start and end of every line in a list before importing it.
- Remove every space from a code, a phone number or a key that must be entered without spaces.
Remove extra spaces: examples
Input
Hello world, how are you?
Result
Hello world, how are you?
Input
apple banana cherry
Result
apple banana cherry
Remove extra spaces: questions and answers
What is the difference between the three tools?
Remove extra spaces keeps single spaces between words. Trim lines only cleans the ends of each line. Remove all spaces deletes every space and tab.
Are line breaks kept?
Yes. Only spaces and tabs are changed; your lines stay in place.
Are tabs treated like spaces?
Yes. Tabs and other blank characters between words are collapsed into one space; use Convert tabs to spaces if you need to keep the indentation.
Does it change non-breaking spaces?
Yes. A non-breaking space counts as a space, so it is collapsed or trimmed like any other.
Is my text sent to a server?
No. Everything runs in your browser on your own device, so your text never leaves it.
Related tools
Tools people often use together with this one.
- Convert tabs to spaces
Swap tab characters for spaces, or the other way round.
- Remove empty lines
Delete blank lines from your text in one click.
- Remove line breaks
Turn many lines into one line in a click.
- Remove punctuation
Delete punctuation marks, or all digits, from your text.
- Remove emojis from text
Strip emoji and pictographs, keep the words.
- Find and replace text
Replace words in your text, with optional regular expressions.