Text tools

Remove Empty Lines

Remove Empty Lines

Delete blank lines from text, including lines that only contain spaces or tabs.

About this tool

About Remove Empty Lines

Copying from web pages, emails, PDFs and chat exports often leaves gaps: double or triple blank lines between paragraphs, or an empty line after every single line of a list. Paste the text and every empty line disappears, including lines that look empty but contain spaces or tabs, which many editors miss. If you want to keep paragraphs readable rather than squash everything together, switch Empty lines to Max one in a row: runs of blank lines shrink to a single one and blank lines at the very start and end are removed. The rest of your text is left untouched, apart from trailing spaces, which are trimmed by default and can be kept by changing Trim to Don't trim. A summary reports how many lines were removed and the line count before and after. The same page can also join broken lines, remove duplicates, collapse spaces or strip HTML when the text needs more than one fix. Nothing is uploaded; it all runs in your browser.

Built and maintained by Abhi JainUpdated

How to Remove Empty Lines

  1. 1

    Paste your text

    Paste into the Text box or open a file.

  2. 2

    Choose how many to keep

    Empty lines is set to Remove all. Choose Max one in a row to keep single gaps between paragraphs.

  3. 3

    Copy the result

    Copy or Download the text without blank lines.

Remove Empty Lines: questions and answers

Are lines with only spaces removed?

Yes. A line counts as empty if it contains nothing but spaces, tabs or other whitespace.

How do I keep paragraph breaks?

Set Empty lines to Max one in a row. Paragraphs stay separated by exactly one blank line while extra gaps are removed.

How do I remove the line breaks too?

Set Line breaks to Join everything to put all the text on one line, or use Remove Line Breaks to join lines inside paragraphs.

Can I remove blank pages from a PDF instead?

Yes, with Remove Blank Pages, which detects empty pages in a PDF file.