Whitespace Remover
Remove spaces, tabs, line breaks, or all whitespace from text. Your work stays on this device whenever possible.
How to use Whitespace Remover
- Paste the text into "Paste text with whitespace".
- Choose a "Cleanup mode": Strip ALL whitespace, Normalize, Remove line breaks only, or Remove horizontal spaces & tabs only.
- Tick "Preserve indentation (leading code spaces & tabs)" when leading indents must survive; it affects only Normalize and the horizontal mode.
- Press "Remove whitespace" and read the [Savings: ...] line showing characters, bytes and percentage removed.
- Save the outcome with "Download clean TXT".
Worked example
Input: "a b", two blank lines, then "c", a tab and "d" (10 characters). Strip ALL gives "abcd" with [Savings: Original 10 chars (10 B) → Cleaned 4 chars (4 B) | 6 chars saved (60.0% reduction)]. Remove line breaks only gives "a b c" plus the tab and "d". Normalize gives "a b", one blank line, then "c d".
When to use this tool
- Squeezing a code snippet onto one line so it can sit inside a JSON string.
- Stripping spaces from a phone or card-style number pasted with gaps.
- Undoing hard line wraps in an email quote by joining the lines.
Important limitations
Completely stripping all whitespace will merge adjacent words together if no delimiter exists. Use normalize mode when human readability must be maintained.
Frequently asked questions
What does Strip ALL remove?
Everything JavaScript treats as whitespace: spaces, tabs, line breaks, the non-breaking space and other Unicode spaces. Words run together, so "a b" becomes "ab". A zero-width space (U+200B) is not in that group and stays.
How does "Remove line breaks only" join lines?
Each run of consecutive newlines is replaced by one space, so lines join with a space and a blank line between paragraphs disappears. Spaces and tabs within lines are left as they are.
How is Normalize different from the Extra Space Remover?
Normalize trims every line, turns runs of spaces and tabs into one space, and allows one blank line between paragraphs. Extra Space Remover offers separate switches, including non-breaking space handling.
Do line endings change?
In Normalize, Windows-style CRLF endings are output as plain newlines, so a file that used CRLF comes back with LF. Strip ALL and Remove line breaks only remove or replace line endings anyway, so this matters only for Normalize.
What is the Savings line based on?
It compares the original and cleaned length in characters and in UTF-8 bytes, and gives the percentage of characters saved. Multi-byte characters make the byte figures larger than the character counts.