Remove empty lines from a text
Paste a list, a copied web page or some code: blank lines are removed at once, and the count of deleted lines is shown under the result. Free, nothing is uploaded.
Free, no sign-up, no limit Runs in your browser: your text and files are never sent or saved.
Remove empty lines
How to use it
- Paste or type your text.
- Choose whether lines with only spaces count as empty, whether to keep one blank line between paragraphs, and whether to trim spaces at the end of lines.
- Copy the cleaned text or download it as a .txt file.
Example
Input
Shopping list Milk Eggs Bread
Output
Shopping list Milk Eggs Bread
Good to know
- With “keep one blank line between paragraphs”, blank lines at the very start and end of the text are still removed.
- Windows line endings (CRLF) are kept if the text uses them. Text pasted in a browser usually arrives with simple line breaks.
- Spaces at the start of lines (indentation) are never changed.
Frequently asked questions
How do I remove empty lines in Notepad++?
Use Edit > Line Operations > Remove Empty Lines (Containing Blank characters) to drop blank lines and lines with only spaces. On this page you get the same result without installing anything, plus the option to keep one blank line between paragraphs.
How do I remove empty lines in Word or Google Docs?
In Word, open Find and Replace (Ctrl+H), search for ^p^p and replace with ^p, then repeat until nothing is found. Google Docs has no such shortcut: copy the text, paste it here, and paste the cleaned version back.
How do I delete empty rows in Excel?
Select the range, choose Home > Find & Select > Go To Special > Blanks, then Delete > Delete Sheet Rows. Careful: a row with a single empty cell is selected too. For a single column of text, pasting it here is safer, since only completely empty lines go.
How do I remove empty lines in VS Code?
Open Find and Replace (Ctrl+H), enable regular expressions (the .* button), search for ^\s*\n and replace with nothing. On this page, the “Lines with only spaces count as empty” option does the same without writing a regex.
Can I keep one blank line between paragraphs?
Yes: tick “Keep one blank line between paragraphs”. Runs of several blank lines shrink to one, so paragraphs stay apart, while blank lines at the very start and end of the text are removed. Indentation at the start of lines is never touched.