Back to Tools

Remove Empty Lines

Instantly clean your text by removing all blank and whitespace-only lines

Cleaned Text

0 Lines Before
0 Lines After
0 Empty Lines Removed

Close the gaps in your text

Blank lines pile up when you copy from web pages, PDFs, emails and spreadsheets. They make lists look sparse, add rows to imports, and break scripts that expect one record per line. Remove Empty Lines scans your text and drops every line that is empty or contains nothing but spaces or tabs.

Using the tool

  1. Paste your text into the Input Text box.
  2. Look at the two checkboxes: Trim Whitespace and Collapse Multiple into Single. Both start ticked.
  3. Click Clean Empty Lines.
  4. The Cleaned Text box shows the result, and three counters report Lines Before, Lines After and Empty Lines Removed.
  5. Choose Copy to put it on the clipboard or Save to download cleaned_text.txt.

How the settings work in practice

  • Every empty or whitespace-only line is removed, whichever way the checkboxes are set. The result has no blank lines at all, including none between paragraphs.
  • Trim Whitespace strips spaces and tabs from the start and end of each line that remains. Untick it if leading indentation matters, for instance in code or nested lists.
  • The Collapse Multiple into Single checkbox is shown on the page, but the current logic already removes all blank lines, so ticking or unticking it does not leave a single blank line behind.

Typical situations

  • Cleaning a pasted list of emails, phone numbers or URLs before loading it into a mailing tool.
  • Tightening a transcript or set of notes that has a blank line after every sentence.
  • Preparing a column of values copied from a spreadsheet so each row becomes one entry.
  • Shrinking a configuration or log excerpt before pasting it into a message.

Points to check

Because paragraph gaps are removed too, running this on prose merges paragraphs into one continuous block of lines. If you need to keep one blank line between paragraphs, use a normalizer that collapses several blank lines into one instead. Lines that contain only invisible characters other than ordinary whitespace may not be treated as blank. The Lines Before figure counts every line in the input, including empty ones. Everything runs in your browser page, and the input box stays unchanged so you can rerun with different settings.


Related Tools

Related Tools


Frequently Asked Questions

Does it keep one blank line between paragraphs?
No. It removes every empty and whitespace-only line, so paragraphs end up on consecutive lines. To keep a single blank line between paragraphs, use a text normalizer that collapses runs of blank lines instead of deleting them.
What does the Collapse Multiple into Single checkbox do?
In the current version it makes no visible difference, because all blank lines are already removed before the result is shown. Leave it as it is; the output will contain no empty lines either way.
What does Trim Whitespace change?
It removes spaces and tabs from the beginning and end of each line that remains after blank lines are deleted. Turn it off if indentation is meaningful, for example in code, YAML or an outline.
Are lines with only spaces counted as empty?
Yes. A line that contains nothing but spaces or tabs is treated as blank and removed, and it is included in the Empty Lines Removed count shown under the result.
Can I save the output as a file?
Yes. Click Save in the Cleaned Text section to download cleaned_text.txt, or use Copy to place the text on your clipboard. The result box is read-only, so edit your input and run it again to change it.
Support Chat
We typically reply within minutes

Hello! 👋 Before we start, please tell us your name.