Remove Extra Spaces
Clean up double spaces, trailing whitespace and blank lines.
Updated · Examples checked by automated tests
0 characters
Cleaned text
The cleaned version appears here.
About Remove Extra Spaces
Text copied from PDFs, web pages and word processors arrives full of invisible clutter: double spaces after full stops, non-breaking spaces, hard tabs and rows of empty lines.
This cleaner normalises all of it in one pass, with each transformation as a separate toggle so you keep exactly the formatting you want and drop the rest.
How Remove Extra Spaces works in your browser
Each clean-up is a separate option: collapse repeated spaces, trim leading and trailing whitespace, convert tabs to spaces and collapse runs of blank lines. Line breaks are kept unless you choose to collapse all whitespace into a single line.
Non-breaking spaces and zero-width characters — common when copying from web pages and word processors — are normalised as well.
When to use it
- Cleaning text copied from a PDF before pasting it elsewhere.
- Removing double spaces from a document.
- Stripping invisible characters that break search or comparisons.
Worked examples
Clean text pasted from a PDF
Settings: Default options
Input
Total amount: 1,200
Due: Friday Expected output
Total amount: 1,200
Due: FridayTabs become spaces, repeated spaces collapse to one, each line is trimmed, and runs of blank lines shrink to a single blank line.
Join wrapped lines into one
Settings: Default options plus Join into one line
Input
The quick brown
fox jumps over
the lazy dog.Expected output
The quick brown fox jumps over the lazy dog.Join into one line replaces every line break and run of whitespace with a single space, which helps when text was hard-wrapped in an email or PDF.
Limits and checks before you use the result
- Do not use it on code, Markdown tables or poetry where indentation and spacing carry meaning.
- Non-breaking and zero-width spaces are normalised by default; turn that option off if you need them preserved.
- It does not fix spacing around punctuation, such as a space before a comma.
Frequently asked questions
What exactly is removed?
Whichever options you enable: repeated spaces collapse to one, leading and trailing whitespace goes, tabs convert to spaces and repeated blank lines collapse.
Are line breaks preserved?
Yes, unless you explicitly choose to collapse all whitespace, in which case the text becomes a single line.
Does it remove invisible characters?
Yes. Non-breaking spaces and zero-width characters, which often sneak in from web pages and word processors, are normalised too.
Guides
Related tools
Text Compare
Compare two texts and see every added, removed and changed line highlighted.
Word Counter
Count words, characters, sentences and paragraphs as you type.
Character Counter
Count characters with live limits for tweets, meta tags and SMS.
Reading Time Calculator
Estimate how long an article takes to read or speak aloud.
Remove Duplicate Lines
Delete repeated lines from a list, with optional case-insensitive matching.
Sort Lines
Sort text alphabetically, numerically, by length or at random.