← Back to Text & Writing Tools

Remove Extra Spaces

Collapse repeated spaces and tabs into single spaces and trim every line, without touching the line breaks.

Checking tool availability…

Remove Extra Spaces works on your text locally in your browser.

Tidy up spacing in pasted text

Double spaces after full stops, tabs used for alignment, text extracted from PDFs, and copy-and-paste from web pages all leave behind uneven spacing. This tool trims the start and end of every line and turns every run of spaces, tabs, or non-breaking spaces into one normal space, so the text is ready to paste into a form, document, or spreadsheet.

How to remove extra spaces

  1. Type or paste your text, or choose Upload Document to open a .txt, .md, .docx, or .pdf file.
  2. The result appears immediately below, with counts of what changed.
  3. Choose Copy Result to use it elsewhere, or Replace Input with Result to keep working here — Undo Replace brings the original back.

Exactly what is changed

  • Spaces and tabs at the start and end of each line are removed.
  • Any run of whitespace inside a line — spaces, tabs, non-breaking spaces, or other Unicode space characters — becomes a single normal space.
  • Line breaks are never removed, and blank lines stay where they are (use Remove Empty Lines to delete them).
  • Zero-width characters are not whitespace and are left unchanged.
Remove Extra Spaces examples
You enterYou get
Hello world Hello world
Name: Jane DoeName: Jane Doe

Your text stays on your device

  • Text is processed by JavaScript running in your browser.
  • Your text is never uploaded to Looty Tools or any other server.
  • Uploaded documents are opened and read in your browser; the file itself is never sent to Looty Tools.
  • Nothing is stored — refreshing or closing the page clears both boxes.

Limitations

  • Uploads accept .txt and .md files up to 5 MB, Word .docx files up to 15 MB, and PDFs up to 25 MB and 50 pages. Older .doc files are not supported, and scanned or image-only PDFs have no text to use.
  • Indentation is removed from every line, so the tool is not suitable for code or indented outlines.
  • Non-breaking spaces become ordinary spaces, which can let a line wrap between words that were meant to stay together.
  • Spaces used to line up columns are collapsed; convert such text to a table first if alignment matters.

Related text tools

Remove Extra Spaces FAQ

What does “extra spaces” mean here?
Any run of spaces, tabs, non-breaking spaces, or other space characters inside a line becomes a single normal space, and spaces at the start and end of each line are removed.
Are line breaks or blank lines removed?
No. Every line break is kept, including blank lines. Use Remove Empty Lines if you also want to delete blank lines.
Why did a non-breaking space become a normal space?
Non-breaking spaces count as whitespace, so they are collapsed along with ordinary spaces. If you need a non-breaking space in a specific place, add it back afterwards.
Does it remove zero-width spaces?
No. Zero-width characters are not treated as whitespace, so they are left in place.
Will this break indentation in code?
Yes — leading spaces are removed from every line, which removes indentation. It is designed for prose and lists, not code.
Can I upload a Word document or PDF instead of pasting?
Yes. Upload Document accepts .txt, .md, Word .docx, and text-based .pdf files, or you can drop a file onto the text box. The file is read in your browser — it is not sent to Looty Tools — and its text replaces whatever is in the box. Scanned PDFs without a text layer and older .doc files are not supported.
Is my text private?
Yes. Spaces are cleaned up in your browser and your text is never uploaded to Looty Tools or saved.

More from Looty

Explore Looty’s Ecosystem

Discover more ways Looty can help you learn, organize, create, and make an impact.