This page cleans the invisible spacing that comes with text copied from a word processor, a CMS or a spreadsheet. It can collapse repeated spaces, turn tabs and non-breaking spaces into ordinary spaces, trim line ends and close the gap before a comma or full stop. Each rule is optional, and the page reports how many of each problem it found.
The counts are taken before any rule runs, so they describe the paste rather than the change. That distinction matters: a run with every rule switched off still reports the repeated spaces it can see, even though it leaves them in place.
What each rule changes
Repeated spaces turns every run of two or more spaces into one. Tabs replaces each tab character with a single space, which is what you want in prose and not in code. Non-breaking spaces replaces the character used by web pages and word processors to stop a line break, which often survives a copy and looks like a normal space until a find-and-replace fails to match it.
Trim removes spaces from the start and end of every line. Gaps before punctuation closes a space before a comma, full stop, semicolon, colon, question mark or exclamation mark. The last whole-text step always removes trailing whitespace at the very end of the paste, whatever rules are selected.
The keep indentation checkbox changes the trim behaviour. With it on, leading spaces are preserved and only trailing spaces are removed, so a code block or an indented outline keeps its shape. With it off, the trim rule removes both ends of each line.
A worked example
A three-line sample was pasted with all five rules on and indentation off. The text held a run of three spaces, two double spaces, a leading tab, two non-breaking spaces and two gaps before punctuation. The result reported 12 characters removed and this breakdown:
| Problem | Found |
|---|---|
| Repeated runs of spaces | 5 |
| Tabs | 1 |
| Non-breaking spaces | 2 |
| Gaps before punctuation | 2 |
Three changes are visible in the output. The tab at the start of the second line became a space. intent , became intent, and here . became here. The non-breaking spaces around non-breaking became ordinary spaces, and the trailing spaces at the end of each line disappeared.
A second run kept a code block with indentation on. The four leading spaces on the return line survived, while the trailing tab on that line and the tab after the closing brace were removed. The counts still reported two tabs, because they count the input, not the replacements.
The no-rules case exposes a wording bug
A third run selected no rules at all and pasted two text lines separated by a blank line. It reported two characters removed, and the checklist line read Leading and trailing spaces trimmed. Neither leading nor per-line trailing spaces were touched: only the spaces at the very end of the whole paste were stripped by the final step.
So the checklist describes the default state rather than the rules in force. If you deliberately deselect everything to inspect the text, expect that line to be wrong and check the output yourself. The same applies to the repeated-runs line: it is informational, not a statement that the spaces were collapsed.
This is a wording defect, not a data one. The character count is accurate, and the cleaned text is exactly what the selected rules produce.
Cleaning prose without breaking code
For an article, a product description or a meta description, turn on every rule and leave indentation off. That removes the artefacts readers never see and the ones that do show, such as a space before a comma. Check the first line of the output if the text began with a deliberate indent.
For code, configuration or anything where leading whitespace carries meaning, keep indentation on. Collapsing repeated spaces can still change alignment inside a line, so leave that rule off as well unless you have checked the result. Tabs are safer to convert only when the file does not depend on them.
Non-breaking spaces are worth converting in prose and risky in code or in strings that are compared byte for byte. They are also the character most likely to survive a copy from a web page unnoticed, which is why the counter is useful even when you change nothing.
After the spaces, check the lines
This tool does not remove empty lines or join wrapped text. If the paste also has doubled paragraph breaks, run it through the extra line remover afterwards. Do the spacing first, then the blank lines, so the line count you see at the end reflects the text you are keeping.
Neither tool rewrites words, normalises quotes or fixes grammar. They are formatters, and the output is only as good as the rules you chose. Copy or download the result and compare it with the source before replacing anything published.