Spaces remover

Remove spaces from input text by pasting your text to textarea.

Your text is processed in your browser and never sent to our server.

What to do with spaces

0 characters · 0 words · 0 lines

How to use the spaces remover?

Simply insert your text into the left textarea. This text will be then formatted immediately in the right textarea.

You are free to choose between removing only duplicate spaces inside the text or removing all spaces. Simply pick one of the options located above the textareas.

  • Replace multiple spaces with a single space – every run of two or more spaces becomes one space, so words stay separated.
  • Remove all spaces – deletes every space, e.g. to clean up phone numbers, IBANs or codes. Line breaks are kept, so each line stays on its own row.
  • Trim spaces at line starts and ends – removes indentation and trailing spaces from every line.
  • Include tabs and non-breaking spaces – treats tabs and invisible non-breaking spaces (often copied from websites and Word) like normal spaces.
  • Also remove line breaks – joins all lines into a single line.

More about removing spaces

Where are extra spaces coming from?

Usually, apps like web browsers include extra spaces when copying text from more parts of the website. Websites and word processors also often contain non-breaking spaces, which look like normal spaces but are different characters.

Is it safe to paste text here?

This site is not storing or processing your pasted text on the server. Text is processed inside your browser. So you can paste text here without any worry.

How does this tool work?

This tool is using JavaScript (browser programming language) built-in regular expressions to remove spaces.

For removing duplicate spaces:

string.replace(/  +/g, ' ')

For removing every space (but keeping line breaks):

string.replace(/[ \t]+/g, '')

This is the common way how to get rid of extra spaces.

How to remove empty lines?

To remove empty lines from the text, go to the empty lines remover tool. This tool is specialized for that job.