Paste your text to instantly collapse multiple consecutive spaces into a single space, with an option to trim leading and trailing whitespace.
Google AdSense Banner
This area will contain advertisements after approval.
Google AdSense Banner
This area will contain advertisements after approval.
This tool scans each line of your text and collapses any run of consecutive spaces or tabs down to a single space, a common cleanup step for text pasted from PDFs, old documents, or other sources that leave irregular spacing behind.
This tool only affects horizontal whitespace within each line, it never deletes a line, even a blank one. Our Remove Empty Lines tool handles removing blank lines themselves. Use both together for a thorough text cleanup.
Given the line 'This has extra spaces' (with irregular runs of multiple spaces), the result collapses down to 'This has extra spaces', every run of consecutive spaces becomes a single space. With 'Trim Leading/Trailing Whitespace' also enabled, any spaces at the very start or end of that line would be removed entirely rather than collapsed.
Expecting this to also remove blank lines, it only cleans up horizontal spacing within each line and never deletes a line entirely, use Remove Empty Lines alongside it for a complete cleanup.
Assuming this fixes spacing issues caused by tabs mixed with spaces for alignment (like in code), it collapses any run of spaces or tabs to a single space, which can actually break intentional tab-based alignment rather than fix it.
Running this on content where multiple spaces are meaningful, like pre-formatted text or certain markup languages, collapsing intentional multi-space formatting could change how that content is meant to display.
No, blank lines are left in place. Use our Remove Empty Lines tool if you also want to remove blank lines.
No, only runs of space or tab characters are collapsed, letters within a word are never affected.
Google AdSense Banner
This area will contain advertisements after approval.