Remove empty line

Remove blank physical rows or limit each blank run to a chosen maximum.

freeworks offlinenothing uploaded
ToolEmpty Line Remover
Input
Output
Put this on your own site

The frame below runs the same code as this page, in the reader's own browser. Nothing is sent to us, and nothing is sent to you.

Pick a dark background and the text and panels follow it, so the frame stays readable on a dark page.

Preview

How it works

CRLF/LF input becomes rows, and trim determines whether a whitespace-only row is blank unless that check is disabled. A run counter either filters every blank or retains only the requested leading portion before joining rows with LF.

  • Whitespace-only rows count as blank and zero blanks survive by default for compact output.
  • A positive maximum preserves paragraph separation without keeping arbitrary vertical gaps.

Worked example

Clean Up Text
Remove empty lines scattered throughout a text block
Input
											line one

line two


line three

line four
										
Output
												line one
line two
line three
line four
											

When to use this

Address imports shed blank records, Markdown drafts keep one paragraph gap, and log excerpts become suitable for line comparison.

Edge cases

  • A trailing newline creates an empty final row that is removed.
  • When whitespace-only matching is off, a row containing spaces survives because it is not literally empty.
  • With a maximum of one, the first blank keeps its original spaces while later rows in that run disappear.