To collapse repeated spaces but keep your paragraphs, turn on Regular Expression, search for [ \t]{2,} and replace with a single space. That pattern only matches runs of two or more spaces or tabs, so line breaks are left alone. The popular \s+ pattern also matches line breaks, which is why it flattens a document into one line.
![Find and Replace with Regular Expression on, pattern [ \t]{2,}: 3 matches replaced, the blank line between the two paragraphs is kept](/blog/remove-extra-spaces-without-losing-paragraphs.png)
[ \t]{2,}, 3 replaced. The blank line between paragraphs survives. Open Find & Replace.Copy this into Input Text. The first line has double and triple spaces; there is a blank line, then a line with a single tab after “Second” and two spaces before “here”.
red blue green Second paragraph here.
[ \t]{2,}. In Replace with, type one space.red blue green Second paragraph here.
The single tab after “Second” is still there, because the pattern needs at least two characters in a row. If you also want lone tabs turned into spaces, run a second pass with \t and a space.
\s means any whitespace character: spaces, tabs and line breaks. Replacing \s+ with one space therefore also replaces the blank line.

\s+ replaced 6 runs, including the line breaks. Both paragraphs are now one line.red blue green Second paragraph here.
That is useful when you really want a single line (for example, a value for a one-line form field), but not for cleaning a document.
Code, poetry and plain-text tables often use runs of spaces on purpose. A global cleanup removes that alignment too. Paste only the prose you want to clean, or clean it in sections.
[ \t]{2,}.[ \t] does not include. Try [ \t\u00A0]{2,}.Everything runs in your browser; the text is not uploaded. Open the free Find & Replace tool.