Polysh for agents is in early access. Your coding agent records the demo, and Polysh finishes it. Join the waitlist →

Remove Extra Spaces

Clean text with single spaces, trimmed lines and no hidden characters.

Loading your browser tool…

What Remove Extra Spaces does

Text copied from PDFs, slide decks, emails and chat tools is full of double spaces, stray tabs, trailing spaces and invisible characters that break search, spell-check and formatting. Paste it here and every run of spaces or tabs inside a line becomes one space.

Keep indentation, on by default, protects the leading spaces of nested list items so an outline keeps its shape. Under More options you can also remove zero-width characters and collapse three or more blank lines into one empty line. When the problem is lines broken in the middle of sentences rather than spacing, use the Line Break Cleaner.

Example

Input

Click   the  Share   button.   



  - Copy	the   link

Result

Click the Share button.

  - Copy the link

Repeated spaces and the tab become single spaces, the trailing spaces go, three blank lines shrink to one, and the two-space indent before the list item stays.

How to use Remove Extra Spaces

  1. Paste the messy text into Your text.
  2. Leave Keep indentation on for lists and outlines, or turn it off to remove leading spaces too.
  3. Check the result and press Copy or Download .txt.

Good to know

  • Remove zero-width characters keeps the zero-width joiner and non-joiner between two visible characters, so joined emoji and scripts such as Hindi or Persian stay intact. Joiners next to a space or line end are removed.
  • Trailing spaces are always trimmed. In Markdown, two trailing spaces create a line break, and those breaks are lost.
  • Spacing inside code or space-aligned tables is collapsed too. Clean only the prose, or paste code separately.

Questions about Remove Extra Spaces

How do I remove double spaces after a period?

Paste the text here. Every run of two or more spaces becomes a single space, including the double space after full stops that many people learned to type. Line breaks and paragraph breaks are not affected.

What are zero-width characters?

Invisible Unicode characters such as the zero-width space and the byte-order mark. They often arrive with text copied from web pages, Word or chat apps, and they can break search, sorting, URLs and code without being visible on screen.

Does it remove non-breaking spaces?

Yes. Non-breaking spaces inside a line are treated like any other space and replaced with a normal single space, which helps when copied text refuses to wrap or match in search.