␣ Remove Extra Spaces
Collapse double spaces into one, remove every space, or just trim the start and end of each line. Catches invisible characters like non-breaking and zero-width spaces too.
How to remove extra spaces
- Paste your text into the input box. Right below it you'll see which kinds of whitespace it contains and how many.
- Choose a mode. The cleaned text appears in the output box immediately, with character counts before and after.
- Press copy to grab the result, or use as input to run it through a different mode.
The three modes
| Mode | Input | Output | Good for |
|---|---|---|---|
| Multiple spaces → one | Hello world | Hello world | Text pasted from web pages, PDFs or emails; fixing double spaces after periods |
| Remove all spaces | 4111 1111 1111 1111 | 4111111111111111 | Card, account, phone and tracking numbers; codes and keys |
| Trim leading/trailing only | Title | Title | Spreadsheet cells and lists with stray indentation or trailing spaces |
"Remove all spaces" keeps line breaks by default. To join everything onto a single line, turn on Remove line breaks too, or use the line break remover, which joins lines with a space so words don't run together.
Invisible whitespace characters
Text copied from websites, PDFs, chat apps and word processors often contains characters that look like a normal space (U+0020) but aren't. They're the reason an Excel VLOOKUP fails, code won't compile, or a search can't find a word that's clearly there.
- Tab (U+0009) — appears between cells when you copy from a spreadsheet.
- Non-breaking space (U+00A0) — HTML's
. Very common in text copied from web pages, and not matched by a normal space search. We also handle U+1680, U+2000–U+200A (spaces of different widths), U+202F and U+205F. - Full-width space (U+3000) — the ideographic space typed by Chinese, Japanese and Korean input methods.
- Zero-width characters (U+200B–U+200D, U+2060, U+FEFF) — they take up no space at all. The byte-order mark (BOM) at the start of a file and leftovers from rich-text editors are typical sources. When checked, they're always deleted, whatever the mode.
In a regular expression the same cleanup looks like /[ \t\u00A0\u3000]+/g. Want to experiment with patterns? Try the regex tester.
Common uses
- Payment and phone numbers — many checkout and banking forms only accept digits. "Remove all spaces" strips the gaps in one go.
- Excel and Google Sheets — one trailing space makes "Apple" and "Apple " different values, breaking lookups, pivots and duplicate removal. Excel's
TRIM()doesn't remove non-breaking spaces; this tool does. - Articles and papers — copied text often has double spaces between sentences or NBSPs mixed in. "Multiple spaces → one" is the safest choice.
Everything runs in your browser — nothing is uploaded. Removing all spaces from normal sentences makes them unreadable, so for prose use "Multiple spaces → one".