Skip to content
XUtilHub

Remove All Whitespace Online

Remove all spaces, tabs and line breaks from text. Optionally keep line breaks. Free online tool.

  • Free, no sign-up
  • Runs in your browser, nothing uploaded
Input
Output

About the Remove Whitespace

Strip every whitespace character (spaces, tabs and line breaks) from your text, or keep the line breaks if you prefer.

Key features

  • Strips every space, tab and line break
  • Option to keep line breaks and strip only spaces/tabs
  • Removes Unicode whitespace too (e.g. non-breaking spaces)
  • Ideal for codes, keys, IBANs and phone numbers
  • Instant results
  • Private, in-browser

Remove all whitespace

Sometimes every space is unwanted: IBANs and card numbers copied with spaces, license keys and coupon codes formatted in groups, phone numbers, API tokens that wrapped across lines, or Base64 strings broken into 76-character lines. Remove Whitespace strips them all.

Examples

InputOutput
GB82 WEST 1234 5698 7654 32GB82WEST12345698765432
+44 20 7946 0958+442079460958
ABCD-EFGH IJKLABCD-EFGHIJKL
Base64 split over 3 linesOne continuous line

Options

ModeBehaviour
DefaultRemoves spaces, tabs and line breaks
Keep line breaksRemoves spaces and tabs, one result per line

Keeping line breaks is handy when you have a list of codes or numbers to clean at once.

Tips

  • Hidden characters: text copied from web pages often contains non-breaking spaces (U+00A0) that look like normal spaces but break validation. This tool removes them.
  • Don't use it on prose: words will run together. Use Remove Extra Spaces instead.
  • JSON: use the JSON Minifier, which keeps spaces inside string values.

Remove only line breaks with Remove Line Breaks, or tidy spacing with Remove Extra Spaces.

How to use the Remove Whitespace

  1. Type or paste your text into the input box.
  2. Choose the options you want.
  3. The result updates instantly as you type.
  4. Copy the output or download it as a .txt file.

Frequently asked questions

What's the difference from Remove Extra Spaces?

Remove Extra Spaces collapses spaces to one and keeps words separated. Remove Whitespace deletes all whitespace, joining everything together.

Can I keep one item per line?

Yes. Enable 'Keep line breaks' to remove spaces within each line while keeping the lines.

Does it remove non-breaking spaces?

Yes. All Unicode whitespace characters are removed, including the non-breaking spaces that often hide in copied text.

Will it break my JSON or code?

It removes spaces inside strings too. To compact JSON safely, use the JSON Minifier.

Is my text sent anywhere?

No. All text tools run locally in your browser.

Do these tools support Unicode?

Yes. They handle Unicode text, including emoji and accented characters.

Last updated:

Related Text tools