Remove empty lines

Delete blank lines from text.

0 lines · 0 characters

0 lines · 0 characters

Results update as you type.

Runs in your browser. Nothing uploaded.

How to remove empty lines

  1. Paste your text into Input. Blank lines are removed as you type.
  2. Keep Also remove lines with only spaces on to catch lines that look empty but hold spaces or tabs.
  3. Copy or download the result. The line under the boxes shows how many empty lines were removed.

Where blank lines come from

  • Text copied from PDFs and web pages, where the gap between paragraphs turns into one or more empty lines.
  • A spreadsheet column copied with empty cells, which pastes as blank lines between the values.
  • Exports and logs that end every record with an extra line break.
  • Lists where entries were deleted but the lines they sat on were not.

Removing them is often the first step before Sort lines or Remove duplicate lines, since blank lines otherwise sort to the top or count as values. Your text stays in your browser throughout.

Lines that only look empty

A line holding a couple of spaces or a tab looks identical to an empty one in most editors, but code, CSV importers and spreadsheet lookups treat it as content. That’s why the whitespace option is on by default. In the example above, turning it off leaves two lines in place: one with three spaces and one with a tab.

Turn it off when you want to find those lines rather than remove them, for example to see where stray whitespace is creeping into an export.