Remove Extra Spaces
Remove extra spaces, double spaces, tabs and blank lines from any text and copy the clean result.
0 characters in · 0 out · 0 removed
Paste some text above to remove the extra spaces.
How it works
Paste your text and the cleaned version appears instantly. By default the tool collapses every run of two or more spaces into a single space, trims the whitespace at the start and end of each line, turns tabs into single spaces, replaces non-breaking and zero-width spaces (the invisible characters that sneak in when you copy from a website or PDF) with normal ones, and drops stray spaces sitting in front of punctuation. Runs of blank lines are squashed to one, blank lines at the very start and end of the text are dropped, and you can also keep or delete every blank line — while “Remove all spaces and tabs” strips whitespace completely and keeps only your line breaks.
Every option is applied with plain JavaScript regular expressions running in your own browser: the text is never uploaded, so it is safe to clean up contracts, code, e-mail drafts or anything else confidential. Use Copy result or Download .txt when you are happy with the output.
Frequently asked questions
How do I remove extra spaces from text?
Paste your text into the box above. The tool instantly collapses every run of two or more spaces into a single space, trims the whitespace at the start and end of each line, converts tabs to single spaces and squashes runs of blank lines. Then press Copy result, or Download .txt to save the cleaned text.
How do I remove all spaces from text, not just the extra ones?
Tick the "Remove all spaces and tabs" option. Every space and tab is deleted so the words run together, while your line breaks stay intact — useful for cleaning up codes, IDs, IBANs or phone numbers that were pasted with stray spacing.
Why does my text still look wrong after a find-and-replace in Word?
Text copied from websites and PDFs often contains non-breaking spaces (U+00A0) and zero-width characters that look like a normal space but never match one in find-and-replace. The "Fix non-breaking & invisible spaces" option converts or deletes them, which is why this tool cleans text that Word or Google Docs leaves untouched.