Remove Extra Spaces
Collapses runs of spaces and tabs to one and trims the ends of every line.
Results
What this tool does
Text copied out of a PDF, a slide deck or a web page arrives padded with spaces that were doing the work of layout. They are invisible until the text lands somewhere that cares — a spreadsheet cell that will not match, a name that sorts in the wrong place, a search that finds nothing. This squeezes every run of spaces and tabs down to a single space, trims the start and end of each line, and leaves the line structure alone.
Formula
reduces each run of spaces to one and trims those at the ends of each line
Variables
| Symbol | Meaning | Unit |
|---|---|---|
text | Your text | — |
OUT | Cleaned text | — |
CB | Characters before | — |
CA | Characters after | — |
CR | Characters removed | — |
Worked example
- Your text This sentence has far too many spaces. And so does this one.
- Cleaned textThis sentence has far too many spaces. And so does this one.
- Characters before87
- Characters after60
- Characters removed27
Limitations
- The calculation runs entirely in your browser. The values you type are never sent to a server.
Frequently asked questions
Does it touch line breaks?
No. Spaces and tabs inside each line are collapsed and the ends of each line are trimmed, but the lines themselves stay exactly where they were, blank lines included. If you want the whole thing turned into a single paragraph, that is what the line-break remover does.