Extra whitespace sneaks into text from copy-pasting, misaligned tables, or careless formatting — double spaces after periods, trailing spaces at the end of lines, or entire blocks that need to be squeezed tight for a code or data field. This tool offers three modes: collapse runs of spaces and tabs down to a single space while also trimming each line, trim only the leading and trailing whitespace on each line while leaving internal spacing alone, or remove every whitespace character entirely for a completely compact string.
Collapse mode squeezes multiple spaces or tabs within a line down to one space, and also trims each line's leading/trailing whitespace. Trim lines mode only removes the leading and trailing whitespace on each line, leaving multiple internal spaces untouched.
Yes — that mode removes every whitespace character, including spaces, tabs, and line breaks, producing one continuous string with no gaps at all.
Collapse and Trim lines modes will strip leading whitespace used for indentation, which is useful for plain text but would flatten intentional code indentation — for code, this tool is best used on prose rather than formatted source.
There are three modes. Collapse squeezes runs of spaces and tabs into one and trims each line. Trim lines only clears the space at the start and end of each line and leaves the gaps inside alone. Remove all strips every whitespace character, line breaks included.
Pick the gentle one when you're fixing text. Double spaces after periods, trailing spaces from copy-paste, and tabs from a spreadsheet all vanish under Collapse. Pick Remove all when you need a compact string for a code, an ID or a field that must contain no spaces.
The tool shows the result immediately, so you can try each mode on the same text and see what each one does before copying.
too many spaces here
too many spaces here
Remove all joins words together, which makes the text hard to read again. Keep your original around until you've checked the output.