Remove extra spaces and empty lines
- Free
- No sign-up
- No upload
- Works offline
Tool facts
- Opens
TXTMDCSV- Saves as
TXT- Price
- Free, no sign-up, no watermark
- Are files uploaded?
- No. Everything is processed in this browser, on your device.
- Batch processing
- One file at a time
- Offline use
- Works without a connection once this page has loaded
- Browser
- A recent Chrome, Edge, Firefox or Safari, on computer or phone.
Check it yourself: press F12, open the Network tab, then use the tool. No request carries your data.
About Whitespace Cleaner
Whitespace Cleaner removes the messy spacing that text picks up when it is copied from PDFs, web pages, emails and word processors. It trims spaces at the start and end of every line, turns runs of spaces into a single space, collapses or removes empty lines, and can join hard-wrapped lines back into normal paragraphs. The cleaned text updates as you change the options, and a counter shows how many characters were removed.
It also deals with characters you cannot see. Non-breaking spaces, thin spaces and other Unicode spaces are turned into normal spaces, and zero-width spaces, byte order marks and soft hyphens, which often break searches, spreadsheets and code, are deleted. Windows and old Mac line endings are converted to standard line feeds. Tabs can be replaced with four spaces, and spaces before commas and full stops can be removed. The Chinese and Japanese full-width space is left alone unless you choose to convert it.
Whitespace Cleaner runs entirely in your browser. Your data is processed on your device and is never uploaded to Qiyi or anyone else.
How to use Whitespace Cleaner
- Paste your text into the Input box, or click Open file.
- Choose what to clean: Trim lines, Collapse repeated spaces, Remove invisible characters and the other switches under Options.
- Under Empty lines choose Keep, Max one or Remove all, and under Line breaks choose Keep, Paragraphs (unwrap hard-wrapped lines) or One line.
- Copy or download the cleaned text from the Output box.
Frequently asked questions
How do I fix text copied from a PDF with a line break after every line?
Set Line breaks to Paragraphs. Single line breaks inside a paragraph are replaced with a space, while blank lines between paragraphs are kept. One line turns the whole text into a single line.
What are invisible characters and why remove them?
Zero-width spaces (U+200B), word joiners (U+2060), byte order marks (U+FEFF) and soft hyphens (U+00AD) take up no visible space but are still part of the text. They can make two identical-looking words not match, break formulas and imports, and add hidden characters to URLs. Remove invisible characters deletes them.
What is a non-breaking space?
A non-breaking space (U+00A0) looks like a normal space but stops a line break and is not matched by many search tools. Word processors and web pages insert them often. Normalize Unicode spaces turns them, and other special spaces such as thin and narrow no-break spaces, into ordinary spaces.
Will it remove the line breaks I want to keep?
No, not with the default settings. By default line breaks are kept, every line is trimmed, and several empty lines in a row are reduced to one. Only the Paragraphs and One line settings remove line breaks.
Is my text uploaded?
No. All cleaning is done with JavaScript in your browser; the text never leaves your device.