Updated · Built and checked by the PlinzoTools team, formulas tested against published sources
Strip blank lines from text, or collapse consecutive blank lines to one.
Line one
Line two
Line threeThis tool cleans up blank lines in text -- either removing every blank line entirely, or collapsing runs of multiple consecutive blank lines down to a single one, useful for cleaning up excessive paragraph spacing without eliminating intentional breaks entirely.
Paste text and choose "Remove all blank lines" or "Collapse consecutive blank lines to one." The cleaned-up version appears instantly.
"Remove" mode deletes every line that's empty or whitespace-only, tightening the text with no blank-line spacing left at all. "Collapse" mode keeps a single blank line wherever one or more originally existed, preserving paragraph breaks while trimming excessive double/triple spacing.
For trimming extra spaces within lines (not blank lines between them), see the Whitespace Trimmer.
The tool splits your text at every line break, whether the source uses Windows-style or Unix-style endings, and then rebuilds it joined with plain line breaks. In the remove mode, any line that is empty or contains only spaces and tabs is dropped. In the collapse mode, the first blank line in a run is kept and any further consecutive blank lines are dropped. Note that a kept blank line is left exactly as it was, so if it contained a few spaces, those spaces stay.
The starting sample is "Line one", an empty line, "Line two", two empty lines, and "Line three". In remove mode the output is three consecutive lines with no gaps: Line one, Line two, Line three. In collapse mode the output keeps one empty line between each pair, giving Line one, a blank line, Line two, a blank line, Line three. The double gap before Line three has become a single gap. Switching the dropdown between the two modes lets you compare the results immediately.
For prose, such as an article pasted from a PDF, collapse mode usually gives the best result, because it removes stray extra gaps while keeping paragraph separation. For structured data such as a list of URLs, email addresses, product codes or log entries, remove mode is normally what you want, since each entry should sit on its own line with nothing between. For source code, be more careful: blank lines often separate logical blocks and improve readability, so collapse mode is gentler, and you may prefer to leave blank lines alone entirely in formats where they carry meaning, such as Markdown paragraphs.
Compare the number of lines before and after in your editor if the count matters. If the output still looks spaced out, the extra space may come from long wrapped lines rather than true blank lines, or from paragraph spacing applied by the application you are pasting into rather than by the text itself.
"Collapse" if you want to preserve paragraph breaks (single blank lines) while removing excess double/triple spacing; "Remove" if you want the text as tight as possible with no blank lines at all.
A line that's completely empty or contains only whitespace (spaces/tabs) -- a line with any visible character, even a single space between words, isn't treated as blank.
No -- only entire blank lines are affected; use the Whitespace Trimmer to also clean up spacing within individual lines.
It reduces a run of blank lines at the start or end to a single blank line, while remove mode deletes them completely.
The tool reads both Windows and Unix line endings and writes the result with plain newlines, so convert them in your editor if a system needs a specific style.
The cleaning runs in your browser as you type, and your text is simply transformed on the page. Use Copy or Download to take the result with you.
Yes, but review the output. Removing every blank line can hurt readability or change meaning in formats where blank lines are significant, so collapse mode is often the safer choice.
Reference: MDN Web Docs