Skip to content
hateitall

Remove Empty Lines

Close up the gaps in text pasted from a PDF, an email or a spreadsheet.

Processed locallyIn: Text, TXTOut: Text

Loading tool…

How to use remove empty lines

  1. Paste your text.

  2. Choose whether lines with only spaces count as empty.

  3. Choose to remove every blank line or keep one between blocks.

  4. Copy or download the result.

What this tool does

  • Removes empty lines and, if you like, lines holding only spaces or tabs.
  • Can squeeze runs of blank lines down to one, keeping paragraphs apart.
  • Keeps your line endings and reports how many lines were removed.

How the result is verified

The result is scanned again: with "keep one" on, no two blank lines may sit together or at the ends; otherwise no blank line may remain.

Frequently asked questions

Will it remove lines with only spaces?

Yes, with "Lines with only spaces count as empty" on (the default). Turn it off to remove only truly empty lines.

Can I keep paragraph breaks?

Yes. Turn on "Keep one blank line between blocks" and runs of blank lines shrink to one instead of disappearing.

Is my data uploaded to a server?

No. Everything you drop, paste or type is processed by code running in this browser tab. You can check it yourself: open your browser's developer tools, watch the Network panel, and use the tool. No request carries your data.

Strip spaces and tabs from the start or end of every line

Text · TXT · CSV→ TextLight on device

Collapse runs of spaces and tabs into one space

Text · TXT→ TextLight on device

Hidden characters, spaces, blank lines and quotes cleaned in one pass

Text · TXT→ TextLight on device

Delete repeated lines, keep order, ignore case or spaces

Text · TXT · CSV→ TextLight on device

Paragraph count with words per paragraph, split your way

Text · TXT file→ Paragraph countLight on device