What removing extra spaces means
Whenever you copy text from a PDF, an email, a spreadsheet, or a web page, you usually drag along whitespace you cannot see: double and triple spaces between words, indentation at the start of each line, hidden tabs, and stray blank lines. On screen it all looks roughly the same, but the moment you paste it into a form, a database, or a document it becomes a headache: it breaks layouts, trips field validations, and makes two “identical” strings fail to match.
This tool clears all of that in one step. Paste your text, choose which kind of whitespace to strip, and copy the normalized result. It runs entirely in your browser, so nothing is ever uploaded to a server.
What each option does
You can combine the five checkboxes however you like; they are applied top to bottom.
| Option | What it does | Example |
|---|---|---|
| Collapse multiple spaces | Turns any run of two or more spaces into a single one | hello␣␣␣world → hello␣world |
| Trim each line | Removes spaces at the start and end of every line | ␣␣text␣␣ → text |
| Remove blank lines | Drops lines that are empty or contain only spaces | a + blank line + b → a then b |
| Merge into a paragraph | Replaces every line break with a space, leaving one line | one + break + two → one␣two |
| Remove tabs | Replaces each tab with a single space | a + tab + b → a␣b |
The middle dot ␣ marks a space so you can see it; in your real text it is an ordinary space.
How to use the tool
- Type or paste your text into the first box.
- Tick the boxes you need. Three of them are on by default because they are the most common: collapse spaces, trim lines, and remove tabs.
- Copy the result with the button. The counter tells you how many characters were removed.
A tip: to clean a paragraph pasted from a PDF (where every line arrives chopped off), also switch on “merge into a paragraph” and “remove blank lines”.
Worked example
Start with this text pasted from a document, full of double spaces, a blank line, indentation, and a tab. We show spaces as ␣ and the tab as ⇥:
The␣␣␣report␣␣␣␣is␣␣
(blank line)
␣␣␣finally⇥ready␣␣
With collapse, trim lines, remove blank lines, and remove tabs all switched on, the process runs like this:
| Step | Result |
|---|---|
| Original | The␣␣␣report␣␣␣␣is␣␣ + blank line + ␣␣␣finally⇥ready␣␣ |
| Tab to space | …finally␣ready␣␣ |
| Collapse spaces | The␣report␣is␣ / ␣finally␣ready␣ |
| Trim each line | The report is / blank line / finally ready |
| Remove blank lines | The report is and finally ready |
Every double space, the indentation, the tab, and the empty line are gone, leaving two clean lines back to back. Nothing but whitespace was touched.
Frequently asked questions
Does cleaning ever delete a word?
No. The tool only affects spaces, tabs, and line breaks; it never removes letters, digits, or punctuation. That is exactly why tabs are swapped for a space instead of being deleted: two words separated by a tab stay separated rather than gluing together.
What is the difference between “trim lines” and “merge into a paragraph”?
Trimming lines keeps the line structure and only cleans the edges of each one. Merging into a paragraph removes every line break and leaves the text on one continuous line, which is ideal for pasting into a single-line field.
Is it safe for code or JSON?
For prose, yes. With code, be careful: in languages where indentation is meaningful (such as Python) or inside string literals, stripping indentation or tabs can change the meaning. Use it deliberately in those cases.
Is my text uploaded anywhere?
No. All processing happens locally in your browser with JavaScript. The text never travels to a server, so you can safely clean private data.
What does the “characters removed” counter measure?
It is the difference between the length of the original text and the length of the result. It counts every space, tab, or line break removed. If you tick no option that shortens the text, the counter stays at zero.