Remove extra spaces from text

Updated on October 30, 2026

Text copied from emails, PDFs and web pages often comes with double spaces, spaces at the start and end of lines and too many blank lines. Paste your text here, choose what to clean and copy the result. Your text never leaves your browser.

Options

Characters removed: 0

The text is processed in your browser and is not sent anywhere.

How to use it

  1. Paste the text in the first box.
  2. Tick what you want to clean: spaces at the line ends, repeated spaces and how blank lines are handled.
  3. See the result in the second box and how many characters were removed.
  4. Copy the result or save it to a note.

What gets removed

  • Spaces at the start and end of each line, which get in the way when pasting into forms and spreadsheets.
  • Repeated spaces inside a line: "hello world" becomes "hello world". The non-breaking space, common on web pages, also becomes a regular space.
  • Excess blank lines: you choose to keep all of them, leave just one between paragraphs or remove them all.

Line breaks between one line and the next are kept. If your text came from a PDF and each line is cut in the middle of a sentence, use the clean formatting tool, which joins the lines of each paragraph.

Why extra spaces appear

Stray spaces creep in many ways: people who type two spaces after a period (a habit from typewriters), text centered with spaces instead of formatting, tables copied from web pages and emails forwarded many times. In running text it does not always show, but it can break search (the word "home " with a space is not the same as "home"), text comparison, email lists and imports into spreadsheets and systems.

Combine it with the other tools

After removing the spaces, it is worth running the remove duplicate lines tool: differing spaces often hide lines that are actually the same. For lists, it also helps to sort the lines and check the result.

Frequently asked questions

Is indentation at the start of lines removed?
Yes, if the option to trim spaces at the start of lines is ticked. Untick it if your text uses indentation you want to keep, as in code or a list with subitems.
Do line breaks stay?
Yes. Only spaces and excess blank lines are handled. To join the lines of a paragraph, use the clean formatting tool.
Does it work with tabs?
Tabs at the start and end of lines are removed along with spaces. A single tab in the middle of a line is kept, since it often separates columns.
Is the text stored anywhere?
No. Everything happens in your browser. To keep it, use "Save to a note".

Read also