Skip to main content
FixLines

Remove extra spaces

Clean up double spaces and stray whitespace.

Editor

Ln 1, Col 10 lines0 words0 characters

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

  1. Paste the text with extra spaces.
  2. Choose the tool: remove extra spaces, trim lines, or remove all spaces.
  3. 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

Collapse double spaces

Input

  Hello    world,   how   are  you?  

Result

Hello world, how are you?
Trim the ends of each line

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.

Tools people often use together with this one.

More in Clean upBrowse all text tools