About the Remove Extra Spaces
Text copied from PDFs, emails, web pages and old documents often contains double spaces, spaces at the end of lines, stray tabs and long runs of blank lines. This tool cleans them up in one step. You can turn runs of spaces into a single space, trim the spaces at the start and end of each line, convert tabs to spaces, replace special non-breaking spaces with normal ones and reduce or remove blank lines. A separate switch strips every space and tab, which is useful for codes and long numbers. It shows how many characters were removed so you can see what changed.
Updated October 2026
How to use the Remove Extra Spaces
- 1Paste your text into the left box.
- 2Tick the clean-up steps you want. The defaults suit most documents.
- 3Choose what to do with blank lines: keep, limit to one, or remove.
- 4Read the cleaned text on the right and the note about what was removed.
- 5Copy the result or download it.
Why extra spaces appear
Double spaces after full stops are a habit from the typewriter era. PDFs add spaces where text columns were joined, copy-paste from web pages brings non-breaking spaces, and tables convert to rows of tabs. Spreadsheets and databases then treat what looks like identical text as different, because one value has a trailing space.
Good uses
- Tidying text before importing it into a spreadsheet or database.
- Fixing copy and paste from PDFs and websites.
- Cleaning code comments, README files and logs.
- Preparing text for word counts and comparisons.
- Removing space padding from fixed-width exports.
Settings to try
For ordinary prose, keep the defaults: collapse spaces, trim lines, convert tabs and limit blank lines to one. For code, untick the trim option so indentation survives. For data fields, use Remove every space and tab. If you need to join lines as well, the Remove Line Breaks tool is the next step, and the Text Cleaner handles other odd characters.
Related tools
The Tabs to Spaces Converter changes indentation style, the Find and Replace Text tool handles specific patterns, the Word Counter shows how long the result is, and the Remove Duplicate Lines tool removes repeated lines after cleaning.
Features
- Several spaces to one
- Trim the ends of every line
- Tabs and special spaces to normal spaces
- Limit or remove blank lines
- Option to remove every space
- Character count before and after
Frequently asked questions
How do I remove double spaces from text?
Paste it into the tool with Turn several spaces into one ticked. Every run of two or more spaces or tabs becomes a single space, and the result updates as you type.
What are non-breaking spaces?
They look like spaces but are different characters (U+00A0 and similar), often added by web pages and word processors. They can break searches, sorting and code. The tool can replace them with normal spaces before it collapses runs.
How do I remove blank lines?
Set Blank lines to Remove them all. Lines that contain only spaces or tabs count as blank. To keep paragraphs apart but remove extra gaps, choose Keep at most one in a row.
Can it remove spaces at the start of each line?
Yes. Remove spaces at the start and end of lines trims both ends of every line, which removes indentation. Untick it if you want to keep indentation, for example in code.
Will it change my line breaks or letters?
No. It only touches spaces, tabs and blank lines. Windows line breaks are converted to simple line breaks so that the cleaning works, but the words and punctuation stay as they are.
How do I remove all spaces from a text?
Tick Remove every space and tab. The result has all spaces and tabs removed while line breaks stay. This is useful for tidying phone numbers, account numbers and codes.