Paste text with gaps and get it back without the blank lines. Remove every empty line, keep a single blank line between paragraphs, or only clean up the start and end, and see exactly how many lines were removed.
Last updated:
What to do with blank lines
Enter your values to see the result.
Advertisement
Advertisement
How to use the Remove Empty Lines
Paste your text into the box.
Choose a mode: remove all blank lines, collapse runs into one, or only trim the start and end.
Set options for whitespace-only lines and trimming.
Check the counts and removed line numbers.
Click Copy results to copy the cleaned text.
The three modes compared
Example input (· marks a line containing only spaces):
Input
Remove all
Collapse into one
Trim start/end only
(blank) Apples (blank) · (blank) Bread (blank)
Apples Bread
Apples (blank) Bread
Apples (blank) · (blank) Bread
Where blank lines come from
Copying from PDFs and web pages, which often add a blank line after every paragraph or even every line.
Mixed line endings: a file with Windows CRLF line endings opened as if it used old Mac CR endings can look double-spaced.
Exports and logs that pad records with empty lines.
Whitespace-only lines left in code by editors, which look empty but are not, and are flagged by linters.
Frequently asked questions
What counts as an empty line?
A line with no characters at all. With the whitespace option on (the default), lines that contain only spaces, tabs or other invisible whitespace also count as empty, which is usually what you want for text copied from web pages or PDFs.
How do I keep paragraphs separated?
Choose “Collapse runs into one blank line”. Groups of several blank lines become exactly one, so paragraphs stay separated while the extra gaps disappear.
What is the difference between removing empty lines and removing line breaks?
Removing empty lines deletes only the blank lines and keeps every line of text on its own row. Removing line breaks joins all the lines into one paragraph. Use the Remove Line Breaks tool for that.
Will it change the indentation of my code?
No, unless you tick “Trim spaces”. By default only empty lines are removed and all other lines keep their leading spaces or tabs.
Does it keep Windows line endings?
Yes. If your text uses CRLF line endings, the result uses CRLF too; otherwise it uses LF.
Is there a size limit?
No fixed limit. Everything runs in your browser, and texts with hundreds of thousands of lines are processed in well under a second on a typical computer.
Are all the tools on FreeToolCabin tested for quality and accuracy?
Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.