About this tool
Collapse multiple spaces and trim each line down to single spacing.
Remove Extra Spaces collapses every run of spaces and tabs inside a line down to a single space, then trims the leading and trailing whitespace off each line. Line breaks are left alone, so the shape of your document survives while the messy spacing inside it disappears. It is the quick fix for text that came out of a PDF, a scraped web page, or a spreadsheet cell with padded values.
Open Remove Extra Spaces on AltFTool — it loads instantly in your browser.
Paste or type the text you're working with.
Choose how it should be transformed or analyzed.
Copy the finished text into your document or post.
Runs of spaces and tab characters mixed together collapse to one space, so tab-indented text cleans up in the same pass.
Only whitespace inside each line changes — your line breaks and paragraph layout stay exactly as pasted.
Leading and trailing whitespace is stripped line by line, not just at the start and end of the whole block.
No. Every newline is kept, so a blank line stays a blank line and the number of lines in the output matches the input. Only spaces and tabs within a line are affected.
Yes. Any run of two or more spaces becomes one, including the traditional double space after sentence-ending punctuation, which most modern style guides no longer use.
It removes it. Because every leading space and tab is trimmed, indented code loses its structure — use a code formatter instead if you are working with source files.
Those are left in place. Only ordinary spaces and tab characters are collapsed, so a non-breaking space pasted from HTML survives and can still make two lines look identical but compare as different.