Remove All Whitespace
Remove every space, tab and line break to produce a single unbroken string.
Which characters count as whitespace here
The tool deletes every whitespace character in the text, not just doubled ones, and puts nothing in their place. That covers:
- ordinary spaces, tabs and line breaks;
- the non-breaking space that word processors and web pages often use between a number and its unit;
- thin and narrow spaces used in typesetting;
- the full-width ideographic space used in Chinese and Japanese text, so
東京 タワーbecomes東京タワー; - the invisible byte-order mark that sometimes sits at the start of copied files.
One invisible character survives: the zero-width space (U+200B). Unicode doesn't classify it as whitespace, so it stays in the output. If two strings that look identical still don't match after cleaning, that is a likely cause.
Strings that should have no spaces at all
The tool is meant for data where spaces are noise, not for prose. Typical cases:
| Pasted | Result |
|---|---|
DE AD BE EF | DEADBEEF |
Base64 wrapped over three lines: SGVsbG8s, IHdvcmxk, Lg== | SGVsbG8sIHdvcmxkLg== |
+1 (555) 010-0199 | +1(555)010-0199 |
Other good fits are licence keys, tracking numbers, coupon codes and hex colour lists copied from a document, anywhere a stray space makes a form reject the value.
As the phone number shows, only whitespace goes. Brackets, dashes, dots and plus signs stay. If you need digits only, remove the punctuation separately afterwards.
Choosing between the three space-cleaning tools
The site has three tools that deal with spaces, and they do quite different things to the same input. Take Hello world on one line and again on the next:
- Remove All Whitespace (this page):
Helloworldagain. Every gap is gone, so words merge. - Remove Line Breaks:
Hello world again. Lines are joined and gaps shrink to one space. - Remove Extra Spaces: doubled spaces are reduced to one but the line break stays, so you still have two lines.
If your text has words in it that should stay readable, one of the other two is almost always the right choice.
Frequently asked questions
Why won't my code paste into a form even after removing spaces?+
The value may contain a zero-width space or another invisible character that isn't whitespace, or punctuation such as a dash that the form doesn't accept. Try typing the code by hand to compare, or remove the dashes too.
Can I remove spaces but keep line breaks?+
Not with this tool, which treats line breaks as whitespace and removes them along with everything else. To keep one value per line, clean each line separately or use a find-and-replace tool to replace a single space with nothing.
Does it change letters, numbers or symbols?+
No. Every visible character is kept in its original order and case. The output is the input with the gaps taken out, so its length drops by exactly the number of whitespace characters removed.
Embed this tool on your website
Free to use on blogs, school sites and intranets. Paste this code into your page's HTML; please keep the credit line.
<iframe src="https://utilityapp.lat/embed/text/remove-whitespace" title="Remove All Whitespace" width="100%" height="600" style="border:0;max-width:760px" loading="lazy"></iframe> <p style="font-size:13px"><a href="https://utilityapp.lat/text/remove-whitespace">Remove All Whitespace</a> by UtilityApp</p>