Remove Empty Lines from Any Document
Runs 100% in your browser — your text never leaves this page, and nothing is uploaded or stored.
This remove empty lines tool deletes every blank line — including ones hiding only spaces or tabs — or collapses runs of blanks into one. Use it to remove blank lines from text copied out of PDFs and emails, or delete empty lines online while keeping single paragraph breaks where you want them.
How to use the Remove Empty Lines
- Paste your text into the box — or press Load sample to clean the gappy example document.
- Leave both options off to delete every empty line, including lines that contain only spaces or tabs.
- Or tick Collapse 2+ blank lines into one to keep single paragraph breaks and remove only the excessive runs.
- Tick Also trim each remaining line if you want stray spaces at the line edges removed in the same pass.
- Read the cleaned text in the result box — the note tells you exactly how many empty lines were removed.
About this tool
Blank lines multiply when text is copied out of PDFs, emails, web pages and Word documents. Some are invisible traps — lines filled with spaces or tabs that look empty on screen but are treated as real content by parsers, import tools and scripts, quietly breaking them. This tool removes true blanks and whitespace-only lines alike, and reports exactly how many it removed. If you actually like paragraph spacing, the collapse option is the gentle touch: runs of two or more blank lines shrink to one, keeping your document’s structure while deleting the clutter. The optional trim tidies the start and end of each surviving line in the same pass. Without it, the content of your lines is never touched — indentation, spacing inside lines and line order all survive exactly as pasted, which is why the tool is safe on code, poetry and formatted lists where the remaining lines must not change. Paste in a whole document and the cleanup is instant, however many thousands of lines it holds. Your original sits untouched in its box until you copy the cleaned version from the result box, and everything happens in your browser — nothing is uploaded, so private documents and internal lists are safe here. Once the blank lines are gone, tidy the spacing inside the remaining lines with Remove Extra Spaces.Worked example
Here is the sample document that comes with the tool, cleaned with the default settings (both options off): You pasteFirst line of the document. Second line, after too many gaps. Third line follows a line of spaces. Final line.You get
First line of the document. Second line, after too many gaps. Third line follows a line of spaces. Final line.The note reads “Removed 6 empty lines.” The sample held ten lines — four with text and six without — including one line that contained nothing but spaces. That line counts as empty even with trimming off: the tool judges a line by what remains after spaces, and the four survivors keep their exact original content.
Features
- Removes true blank lines and whitespace-only lines — the invisible kind that breaks imports and scripts.
- Collapse mode keeps single paragraph breaks and shrinks runs of blanks to one line.
- An optional trim for the surviving lines, for a complete tidy in a single pass.
- An exact removal count under every result, so you can verify the cleanup before copying it.
- Content-safe: line order, indentation and spacing inside the kept lines are never altered.
- Private by design: the cleanup runs in your browser; documents never leave your device.