Whitespace Remover
Clean up messy text: collapse extra spaces, trim lines, remove blank lines and tabs, and strip invisible zero-width characters.
Messy text
Cleaned text
How to use the Whitespace Remover
Paste your text and choose a cleanup mode. Tidy is the most common: it collapses repeated spaces and tabs into one space, trims every line and allows at most one blank line in a row. One line joins everything into a single line with single spaces. Remove blank lines only deletes empty lines and leaves the rest alone. Trim only cleans the start and end of each line and keeps inner spacing.
Why whitespace matters
Messy spacing sneaks in from PDFs, OCR scans, scraped web pages, AI-generated drafts and rich-text emails. It makes copy look sloppy and can break YAML, CSV, JSON and other formats where spacing matters. A quick cleanup saves time hunting for the problem.
Common use cases
- Cleaning text copied from web pages or PDF exports
- Tidying AI drafts before pasting them into a CMS
- Preparing CSV or YAML input where stray spaces cause errors
- Removing double spaces after periods
- Fitting names and addresses into form fields
What counts as whitespace
Spaces, tabs, line breaks and carriage returns are the visible kind. The tool also removes invisible characters in every mode: zero-width spaces (U+200B), zero-width joiners (U+200C, U+200D), byte-order marks (U+FEFF) and soft hyphens (U+00AD). Non-breaking spaces (U+00A0) become normal spaces. You cannot see these characters, which is exactly why they cause trouble.
Frequently asked questions
Will this break code indentation?
Tidy and One line both remove indentation. Remove blank lines only keeps it. For code, a code formatter is the safer choice.
Why are there four modes?
"Clean up whitespace" means different things in different jobs. Sometimes you want one line, sometimes you want to keep paragraphs, and sometimes you only want the empty lines gone.
Can it handle large blocks of text?
Yes, long documents clean up quickly in a modern browser. For very large files, a text editor or script is more practical.

