Whitespace Remover
Choose which kinds of whitespace to clean up and see the tidy result.
INPUT
CHARS: 0WORDS: 0LINES: 0
OUTPUT
CHARS: 0WORDS: 0LINES: 0
How the Whitespace Remover works
Each cleanup is a separate switch. Trimming removes spaces and tabs at the start and end of every line. Collapsing replaces runs of several spaces with one. You can convert tabs to spaces, delete blank lines, or remove every space while keeping line breaks.
A separate option replaces non-breaking spaces, thin spaces and other lookalikes with ordinary spaces and deletes zero width characters. These invisible characters are a common reason that two strings that look the same are not treated as equal.
Whitespace Remover examples
Collapse multiple spaces and trim edges
Input
Clean up erratic spacing.
Result
Clean up erratic spacing.
When it is useful
- •Cleaning copied data before pasting it into a spreadsheet or database.
- •Tightening a document that has double spaces after periods.
- •Compressing text for a field with strict length limits.
- •Finding out why a lookup fails because of a hidden trailing space.
Frequently Asked Questions
Will it remove line breaks?
No. Line breaks are kept. Use the Remove Line Breaks tool to join lines.
What is a non-breaking space?
A space that looks normal but prevents a line wrap. It often arrives from web pages and word processors and is a different character from an ordinary space.
Does collapsing spaces affect indentation in code?
Yes, collapsing turns leading runs of spaces into one. Turn that option off, and trim off, if you need to preserve indentation.
Guides that use this tool
Related tools
- Remove Line BreaksTurn text that is chopped into short lines back into flowing paragraphs.
- Remove Text FormattingReduce styled, marked up or decorated text to plain words.
- Plain Text ConverterNormalize text copied from Word, web pages and chat apps into simple characters that work everywhere.
- Duplicate Line RemoverPaste a list and keep each line once, in the order it first appeared.
- Word CounterCount words, characters, sentences, paragraphs and lines instantly. Estimate reading and speaking time and analyze the most frequently used words.