How to use Remove Empty Lines
- Paste your text into Your text.
- Choose a Mode: Remove all blank lines for a tight list, or Keep one between paragraphs for prose.
- Decide on Treat lines with only spaces as empty. It is ticked by default, which is usually what you want.
- Copy the result.
What it does and when to use it
Blank lines creep in when you copy from web pages, PDFs, emails and chat apps. Some sources add an empty line after every line, so a list of 20 names turns into 40 lines. This tool deletes those gaps.
Pick the mode by what you are cleaning:
- Remove all blank lines suits lists, CSV data, log files and code snippets, where every line should hold something. The result is ready to sort, number or paste into a spreadsheet.
- Keep one between paragraphs suits articles, letters and notes, where the space between paragraphs carries meaning but double or triple gaps look untidy.
The space-only option matters more than it seems. A line that holds a single space looks empty but is not, and many tools treat it as content. Leaving the option on catches these hidden lines.
After cleaning a list, you can sort the lines, remove duplicate lines or add line numbers.
How it works
The text is split at every line break. In Remove all blank lines mode, each line is tested: if it is empty (or, with the option on, has nothing but whitespace), it is dropped. The other lines are joined back with line breaks.
In Keep one between paragraphs mode, a blank line is kept only if the line before it held content. That keeps the first blank line of each run and drops the rest. Kept blank lines are emptied, so a line of spaces becomes a truly empty line. Leading and trailing blank lines are then trimmed off. The work happens in your browser.
Worked examples
A list with gaps. “Line one”, two empty lines, “Line two”, a line of three spaces, “Line three”. With the default settings every gap goes: Line one, Line two, Line three on three consecutive lines.
Paragraphs. “Para one”, three empty lines, “Para two”, a space-only line, “Para three”. In Keep one between paragraphs mode the result is the three paragraphs, each separated by exactly one empty line.
Exact emptiness only. “a”, a line of three spaces, “b” with Treat lines with only spaces as empty unticked. The space line counts as content, so nothing is removed and the text comes back unchanged.
Limits and tips
- To join all lines into one paragraph instead, use Remove Line Breaks.
- Stray spaces inside lines are not touched; Remove Extra Spaces handles those.
Frequently asked questions
Is a line with only spaces treated as empty?
How do I keep my paragraphs separate?
Are blank lines at the very start or end removed?
Does it change the lines that have text?
How do we know nothing is uploaded? Test it yourself on the privacy proof page.