How to use the remove extra spaces
- 1Paste your text into Text with extra spaces.
- 2Keep the defaults or adjust Replace repeated spaces with one, Trim spaces at the start and end of lines and Tabs.
- 3Tick Remove every space if you want no spaces at all.
- 4Copy the result from Cleaned text; the footer shows how many spaces were removed.
Example
Too many spaces here. Second line.
Too many spaces here. Second line.
Default settings. The tab becomes a space and is then collapsed with its neighbors; line breaks are kept. 13 spaces removed.
Collapsing multiple spaces
Replace repeated spaces with one turns any run of spaces (and tabs, unless you keep them) into a single space. Double spaces usually come from typing two spaces after a full stop, from justified text in PDFs, or from joining lines that already ended in a space. Line breaks are never collapsed; to remove those, use remove line breaks.
Trimming line starts and ends
Trim spaces at the start and end of lines removes leading and trailing spaces on every line, not just the first and last. Trailing spaces are invisible but break exact matches in spreadsheets and databases. Leading spaces are indentation, so untick this option for code or nested lists where indentation matters.
Remove spaces before , . ; : ! ? fixes word , and word . typed with a stray space.
Tabs and non-breaking spaces
Tabs can be converted to a single space (default), kept, or removed. Convert non-breaking and other special spaces turns U+00A0 no-break spaces, the en, em, thin and hair spaces (U+2000–U+200A), the narrow no-break space (U+202F) and the full-width ideographic space into normal spaces, so they collapse like any other space.
Non-breaking spaces arrive with text copied from web pages and word processors and look identical to normal spaces. Zero-width characters are not spaces at all; find and remove those with the invisible character tool.
Removing every space
Tick Remove every space to delete all spaces while keeping line breaks, which is useful for phone numbers, card or IBAN numbers, product codes and hex strings copied with spaces in them. With Tabs set to Keep tabs, tabs survive, so tab-separated columns stay aligned.
Is my text private?
This tool runs entirely in your browser. Your text is not uploaded to our servers.
