Remove Extra Spaces
Squeeze repeated spaces into one and trim the start and end of every line. Handy for text copied from PDFs, emails and spreadsheets.
Characters: 0Words: 0Lines: 0
Where extra spaces come from
Text pasted from a PDF, an email, a spreadsheet or a web page often contains double spaces, tabs and spaces at the end of lines. They are invisible but cause trouble: they break exact-match searches, create empty-looking cells, and make documents look uneven. Trim extra spaces cleans this in one click.
What each button does
The buttons work on different things, so you can combine them:
- Trim extra spaces: replaces runs of spaces and tabs inside a line with one space and removes spaces at the start and end of each line. Line breaks stay where they are.
- Remove empty lines: deletes lines that are empty or contain only spaces, and keeps the others as they are.
- Remove line breaks: joins all lines into one line separated by single spaces.
Limits
Only ordinary spaces and tabs inside a line are squeezed. Special space characters such as the non-breaking space are treated as letters in the middle of a line, although the ones at the very start or end of a line are trimmed. Everything runs in your browser, so the text you paste is not uploaded.
How to use the Remove Extra Spaces tool
- Paste your text into the box.
- Click Trim extra spaces to replace repeated spaces and tabs with one space and strip each line.
- Click Remove empty lines or Remove line breaks if you also want those cleaned, then copy the result.
Frequently asked questions
What counts as an extra space?
Two or more spaces or tabs in a row are replaced with one space, and spaces at the start and end of each line are removed.
Does it change my line breaks?
Not with Trim extra spaces: every line stays on its own line. Use Remove line breaks if you want everything on one line.
Does it remove non-breaking spaces?
Only at the start or end of a line. A non-breaking space inside a line is a different character and is not squeezed.