Remove Empty Lines

Paste your text to strip out every blank line.

Loading tool…

  • Free
  • No sign-up
  • Runs in your browser

How to use the remove empty lines

  1. Paste the text or list.
  2. Leave the option ticked to also remove lines containing only spaces or tabs.
  3. Copy the result.

When blank lines get in the way

Text copied from web pages, PDFs and emails often arrives with an empty line between every row. That doubles the length of a list, breaks imports into spreadsheets, and makes code hard to read. This tool removes every line that has nothing on it and leaves the rest of your text exactly as it was, including indentation.

A line that looks empty may still contain spaces or a tab. With the option ticked those lines are removed as well, which is nearly always what you want. Untick it if whitespace-only lines are meaningful in your file.

To reduce multiple blank lines to a single one instead of removing them all, use find and replace with the regular expression \n{3,} replaced by two line breaks in the find and replace tool.

Frequently asked questions

Will it change my indentation?

No. Only completely blank lines are removed; the remaining lines are untouched.

Is my text stored or sent anywhere?

No. Everything happens inside your browser. Your text is not uploaded, logged or read by anyone. The page remembers your last text on this device only, so you can pick up where you left off; press Clear to remove it.

Related tools