How to remove extra spaces
- 1 Paste your text into the Your text box.
- 2 Keep or untick the cleaning options.
- 3 The clean text appears instantly in the Result box, with a count of removed characters.
- 4 Copy or download the result.
The invisible characters behind messy text
- Non-breaking spaces (U+00A0) come from web pages and Word. They look like spaces but stop search, sorting and duplicate checks from matching.
- Zero-width spaces (U+200B) are completely invisible and often hide in text copied from apps and chats.
- Tabs from spreadsheets and PDFs line up columns but break forms.
- Extra blank lines pile up when you paste from emails.
This tool replaces all of them with a single normal space and trims each line. If lines are broken in the middle of sentences, run Remove Line Breaks too, or use the Text Cleaner to fix quotes, dashes and HTML in one go.
Features
Double spaces
Every run of spaces becomes a single space.
Trim lines
Removes spaces at the start and end of each line.
Invisible characters
Fixes non-breaking and zero-width spaces that cause odd gaps.
Blank lines
Several empty lines become one.
When to use it
Copied PDF text
Fix spacing problems from PDF copy and paste. Join lines broken in the middle with Remove Line Breaks.
Website content
Clean text before publishing it. Fix quotes and HTML too with the Text Cleaner.
Spreadsheets
Remove stray spaces that break lookups. Then Remove Duplicate Lines from the tidy list.
Code and data
Normalise whitespace in lists and exports. Check the new length with the Character Counter.
Related Text tasks
Frequently asked questions
What is a non-breaking space?
A special space that stops a line from breaking. It looks normal but can cause problems with searches and formulas. This tool turns it into a regular space.
Will it remove single spaces between words?
No. Only extra spaces are removed, so words stay separated by one space.
Can it remove all line breaks too?
Use our Remove Line Breaks tool to join lines into paragraphs.
Why does my spreadsheet formula fail on copied text?
Hidden spaces at the start or end of a cell are a common cause. Clean the text here, then paste it back.
Why is there still a gap after cleaning?
The gap may be a line break rather than a space. Use the blank line option, or join broken lines with the remove line breaks tool.
Can I remove spaces at the start of each line?
Yes. Trimming removes spaces and tabs at the start and end of every line, which is useful for indented text copied from emails and code.
Does it remove spaces inside numbers like 1 000?
Runs of spaces are reduced to one, so 1 000 becomes 1 000. To remove the space completely, use find and replace on the result.
Why does text from a PDF have so many spaces?
PDFs position each word on the page, and copying sometimes adds spaces to keep the gaps. Justified text and tables are the worst cases, and cleaning them here takes one paste.
How this tool works. These text tools run entirely in your browser with plain JavaScript, so the text you paste never leaves your device and results update as you type. Each tool is tested with real text such as copied PDFs, emails, code, lists, emojis and non-English scripts before it goes live.
Built and reviewed by Hamza Farooq, founder and lead developer
· Last updated
· How we check our tools
· Report a problem