Remove Empty Lines From Text
Paste text and this tool deletes every blank line, including lines that only hold spaces or tabs, while keeping your real content in its original order. Turn on 'Trim each line' to also shave stray whitespace off the ends of the lines you keep, or 'Collapse to single blank line' to squash big gaps down to one blank between paragraphs. A live counter shows how many lines were removed.
How to remove empty lines
- Paste or type your text into the 'Your text' box.
- Leave both options off to strip every blank and whitespace-only line.
- Tick 'Trim each line' to remove leading and trailing spaces from kept lines.
- Tick 'Collapse to single blank line' to keep one blank between blocks instead of none.
- Check the 'lines removed' count, then copy the cleaned text from the Result box.
Examples
Strip all blank lines
Apple Banana Cherry
Apple Banana Cherry
Collapse gaps to single blanks
Block one Block two
Block one Block two
Trim while stripping blanks
keep me and me
keep me and me
Frequently asked questions
Does it remove whitespace-only lines too?
Yes. A line counts as empty when it has no non-whitespace characters, so lines made only of spaces or tabs are removed just like fully blank ones. This catches the invisible padding that plain 'delete blank line' tools often miss.
What does 'Collapse to single blank line' do?
Instead of deleting every blank, it keeps exactly one blank line between blocks of text, so paragraph breaks survive while long runs of empty lines are squashed. Leading and trailing blanks are still dropped in this mode.
What does 'Trim each line' do?
It removes leading and trailing spaces and tabs from every line you keep. It also means a line padded only with spaces is seen as blank before trimming, so it gets removed rather than left as an empty trimmed line.
Will the order of my lines change?
No. The content lines stay exactly where they were relative to each other. Only blank lines are removed, so paragraphs, lists and code keep their sequence.
Does it handle Windows and Mac line endings?
Yes. Windows CRLF, classic Mac CR and Unix LF are all recognized when the text is split into lines, and the cleaned output always uses standard LF newlines.
How is this different from removing line breaks?
Removing line breaks flattens everything onto one line. This tool keeps your line structure intact and only deletes the empty lines, so a list stays a list rather than becoming a single run-on line.
Is there a size limit?
There is no fixed cap. The work runs in your browser, so the practical limit is your device memory, and the counter and result update as soon as you paste or change an option.
Can I use this on code or CSV?
Yes. It only touches whitespace and blank lines, so code indentation stays put unless you enable trimming, and empty rows in pasted CSV text are dropped without altering the data rows.
Is my text private?
Yes. Everything runs locally in your browser and nothing is uploaded to a server, so even sensitive text stays on your device.
Learn more
- Why text ends up full of blank lines and how to fix it
The common causes of stray empty lines when copying and pasting, plus when to strip every blank and when to keep paragraph gaps.
Related tools
Remove Line Breaks
Remove line breaks and paragraph breaks from text online. Flatten copied text into one line, keep spaces tidy, then copy the result. Free and private.
Remove Duplicate Lines
Remove duplicate lines from text online and keep the first of each. Options for case sensitivity and trimming whitespace. Free, instant, and private.
Remove Extra Spaces
Remove extra spaces from text online. Collapse double spaces and tabs to one, trim every line, drop blank lines, then copy or download. Free and private.
Acronym Generator
Turn any phrase into an acronym from the first letter of each main word. Skip small words like the and of, keep them, or add dot separators.
Add Line Numbers
Add line numbers to any text online. Set the start value, step, and separator, pad numbers to align, and copy or download the result. Free and private.
AI Sentiment Analyzer
Analyze the sentiment of any text with AI in your browser. Paste a review or comment, get a positive or negative score plus a per-sentence breakdown.