Remove Empty Lines - Delete Blank Lines and Collapse Gaps Online

Text Tools Free to use

Remove blank lines from text in one click

Copied text often comes with gaps: a blank line between every line, long runs of empty lines, or lines that look empty but still hold spaces. This tool removes them and shows how many lines it dropped.

Delete all, collapse or trim the edges

Choose to delete every empty line, to keep a single blank line between blocks of text so that paragraphs stay readable, or to remove empty lines only at the start and end. Lines with only spaces count as empty, and you can also drop lines made only of symbols such as dashes, or lines shorter than a length you set. That last option helps with stray page numbers or leftover bullets in text copied from a document.

How to use Remove Empty Lines

  1. Paste your text into the box.
  2. Choose a mode: delete all empty lines, keep one blank line between blocks, or trim only the start and end.
  3. Tick the extra options if lines with only spaces, symbols or very few characters should go too.
  4. Solve the security check and press Remove.
  5. Check the summary, then copy the result or download it as a text file.

About Remove Empty Lines

A line is empty when it has no characters at all. With the first option on, a line that holds only spaces or tabs is empty too, which is what people usually mean. Delete all empty lines removes every one of them. Keep one blank line between blocks turns any run of empty lines into a single blank line and removes the ones at the start and end of the text, so paragraphs remain separate. Trim start and end leaves the empty lines inside the text alone. The symbol-only option removes lines made only of punctuation or symbols such as ---, *** or ===. The short line option removes lines with fewer visible characters than the number you enter. Different line endings (Windows, Mac and Linux) are all understood, and the result uses plain line feeds.

Purpose of Remove Empty Lines Tool

Use it to tidy text pasted from a PDF, email or web page, to prepare a list for a spreadsheet, to shrink code or log files, to clean subtitles and notes, or to turn double-spaced text into single-spaced lines.

Limitations of Remove Empty Lines

  • Removing all empty lines also removes the gaps between paragraphs. Use the keep one blank line mode when paragraphs must stay apart.
  • The symbol-only option also removes lines such as a lone question mark or bracket. Leave it off when those lines matter.
  • The tool works on lines only. To fix spaces inside lines use the Remove Extra Spaces tool.
  • Text over 5 million characters is refused to keep the page fast.

Privacy and data

Remove Empty Lines runs entirely in your browser. What you type or select is processed on your own device and is never sent to or stored on our server. See our Privacy Policy for details.

Frequently asked questions

What counts as an empty line?

A line with no characters, or with only spaces and tabs when the whitespace option is on. Lines with even one visible character are never removed unless you turn on the symbol or short line options.

How do I keep paragraphs but remove extra gaps?

Choose Keep one blank line between blocks. Every group of empty lines becomes one blank line, so paragraphs stay separate.

Is the empty line remover free and safe to use?

Yes. The empty line remover is free to use and runs in your browser, so your text is not uploaded, stored or logged.

How do I remove blank lines from a list?

Paste the list and choose to delete all empty lines. Lines that hold only spaces or tabs are removed too when the whitespace option is on.

Can I remove empty lines only at the start and end?

Yes. Choose to trim the ends, and blank lines at the beginning and end are removed while the ones between blocks stay.

Rate Remove Empty Lines

No ratings yet. Be the first to rate this tool.

Your rating

Report a bug or give feedback

Tell us about Remove Empty Lines. The subject of your message will name this tool.