Skip to content

Remove Empty Lines

Strip blank lines from pasted text in one click, or keep a single blank line between paragraphs.

Processed locally in your browser

Options
0 chars · 0 lines
The result will appear here.

What is Remove Empty Lines?

Blank lines pile up when you copy from PDFs, e-mails, web pages or code generators. This tool deletes lines that are completely empty and, by default, also lines that contain only spaces or tabs, which look empty but are not.

If you need to keep the paragraph structure, choose the collapse mode: runs of blank lines are reduced to a single blank line and leading or trailing blanks are dropped. The notes report how many lines were removed.

How does it work?

  1. Paste the text that contains blank lines.
  2. Leave "also remove lines with only spaces or tabs" on to catch invisible blanks, or turn it off to remove only truly empty lines.
  3. Tick "keep one blank line between paragraphs" to collapse instead of removing, then copy the result.

Common use cases

  • Cleaning text copied from a PDF where every line is followed by a blank line.
  • Compacting a list before sorting or deduplicating it.
  • Tidying generated code or configuration with random gaps.
  • Turning double-spaced e-mail quotes into compact text.

Examples

Try this input in the tool above:

Input
Line one


Line two
   
Line three



Line four
Output
Line one
Line two
Line three
Line four

Privacy

Remove Empty Lines runs entirely in your browser. The text or files you provide are processed on your device and are not uploaded, logged or stored on our servers.

Limitations

Only whole lines are removed; extra spaces inside a line are untouched. Use Remove Extra Spaces or Trim Lines for those.

Frequently asked questions

Why does a line that looks empty survive?

It probably contains spaces, a tab or a non-breaking space. Keep the whitespace-only option on (non-breaking spaces count as whitespace too).

How do I keep paragraphs separated?

Choose "keep one blank line between paragraphs": multiple blank lines become one and the paragraphs stay visible.

More tools in Text Tools →