textcleanups

Remove empty lines

Delete the blank lines from your text, or shrink long gaps down to a single blank line.

Options
Blank lines

Your text stays in your browser. Nothing is uploaded or saved.

How to remove empty lines

  1. Paste your text into the first box.
  2. Pick Remove all to delete every blank line, or Max one in a row to keep paragraph spacing but remove the big gaps.
  3. Copy the result from the result box.

Lines that look empty but aren't

A line can look blank but still contain spaces or tabs. These are common in text copied from websites, code editors and spreadsheets. Many find-and-replace tricks miss them. With Treat lines with only spaces as empty on, they're removed too.

Remove all or keep one

Remove all is best for lists, code and data, where every blank line is noise. Max one in a row is best for prose: paragraphs stay separated by a single blank line, and the gaps of three or four blank lines that pile up after copying and pasting are reduced to one.

Common uses

  • Tidying lists copied from web pages
  • Cleaning exported chat logs and transcripts
  • Preparing data for import into a spreadsheet or database
  • Removing blank lines from code or config files

Questions

Will it remove my paragraph breaks?

Only if you choose Remove all. Choose Max one in a row to keep a single blank line between paragraphs.

Why do some blank lines not disappear in other tools?

They usually contain spaces or tabs you can't see. This tool treats those lines as empty by default.

How do I remove blank lines in Notepad++ or VS Code?

Both support regular expressions in Find and Replace: search for ^\s*$\n and replace with nothing. Pasting here does the same without needing the pattern.