Remove extra spaces
Fix double spaces, tabs, spaces at line ends and invisible spaces. Ctrl+C copies the result.
PrivateNo uploadsRuns in your browserRecipe
Tidy spaces
How to remove extra spaces
Paste your text
Paste text copied from a web page, PDF, chat or spreadsheet, or open a file.
Choose what to fix
Double spaces, the ends of lines, tabs, odd invisible spaces and the space before punctuation each have their own switch.
See and copy
Changes shows every removed space as a dot. Copy or Download the tidy text.
Good to know
- Indentation at the start of a line is kept if you choose Trim: End only, which is handy for code and poems.
- Remove all spaces is a separate step for codes and numbers that must have no spaces at all.
- Joining characters used in emoji and some scripts are left alone, so words and emoji are never broken.
- Big files are fine. Drop a text file of 50 MB or more: the work happens in the background, the page stays smooth, and Download saves the full result.
Where people use it
Text from a PDF or email
Remove double spaces and odd gaps so the text looks normal again.
Data for a spreadsheet
Trim spaces at the ends of lines before you paste into Excel.
Hidden characters
Clear invisible spaces that break searches and form checks.
Blank lines too
Remove empty lines after fixing the spaces.
Remove empty lines from textLines broken in the middle
Join broken lines and do more in the full text cleaner.
Text cleaner
Why this one
It finds hidden spaces you cannot see and shows each one it removed.
- Fixes double spaces, tabs and invisible spaces.
- A changes view marks every space removed.
- Nothing leaves your device.
What you can change
- Double spaces to one
- Trim line starts, ends or both
- Tabs to a space
- Spacing around punctuation
People find this page by searching
- remove extra spaces
- remove double spaces
- remove spaces from text
- trim whitespace online
- remove tabs from text
- remove invisible characters
- fix spacing in text
Cite this tool
- APA
sdev.in. (n.d.). Remove extra spaces and tidy text [Web tool]. https://www.sdev.in/tools/remove-extra-spaces
- MLA
"Remove extra spaces and tidy text." sdev.in, https://www.sdev.in/tools/remove-extra-spaces.
- Chicago
sdev.in. "Remove extra spaces and tidy text." https://www.sdev.in/tools/remove-extra-spaces.
- BibTeX
@misc{sdev-remove-extra-spaces, title = {Remove extra spaces and tidy text}, author = {{sdev.in}}, howpublished = {\url{https://www.sdev.in/tools/remove-extra-spaces}}, note = {Web tool} }
Questions people ask
What are invisible spaces?
Non-breaking spaces and zero-width spaces come in with text copied from web pages, PDFs and messaging apps. They look like normal spaces or nothing at all, but stop searches and formulas from matching. This tool turns them into normal spaces or removes them.
Can I remove all spaces, even between words?
Yes. Add the Remove all spaces step. You can keep the line breaks or join everything into one line.
Will it remove the gaps between paragraphs?
No. Line breaks stay as they are. Add Empty lines if you also want to remove or squeeze blank lines.
Is my text uploaded anywhere?
No. Every step runs in your browser, on your own device. Nothing you paste or open is sent to a server or kept anywhere except this page.