Remove Empty Lines
Collapses blank lines while preserving real paragraph breaks — a narrower job than remove-line-breaks.
This strips lines that contain nothing but whitespace, tightening up text that's accumulated stray blank lines — commonly from pasting between apps, copying from a spreadsheet with empty rows, or exporting code with inconsistent blank-line spacing. It's a narrower, more surgical operation than /remove-line-breaks/, which handles the different problem of PDF-style mid-sentence hard wraps.
The cleaned-up text appears here as you type.
Why this is a different job from remove-line-breaks
A truly empty line (nothing, or only spaces/tabs, between two line breaks) is removed entirely. A line with actual content, even a single character, is always preserved, and — critically — this tool preserves the paragraph-separating role of blank lines where you want it: an option lets you collapse multiple consecutive blank lines down to exactly one (keeping paragraph separation intact) rather than removing every blank line and merging all paragraphs into one continuous block.
This is the key distinction from /remove-line-breaks/: that tool rejoins a sentence that a PDF viewer split mid-thought when the source document wrapped a visual line, while this tool solves the separate problem of too many or entirely unwanted blank lines between blocks of text that are otherwise already correctly formatted. Running both tools on the same messy paste (line-break removal first, then empty-line cleanup) is a common two-step cleanup for text extracted from PDFs or scraped web pages.
The "collapse to one blank line" mode versus "remove all blank lines" mode matters depending on your goal: collapsing to one preserves visual paragraph structure while tightening up excessive spacing (three blank lines in a row down to one); removing all blank lines entirely is closer to what you want when converting a document into a single continuous block, like preparing text for a word count that shouldn't be affected by spacing at all.
Who uses this
- Tightening up excessive blank-line spacing in a document pasted from a source with inconsistent formatting.
- Cleaning code or config files exported with extra blank lines between sections.
- Removing all blank lines from a list-style paste (like a CSV export) where blank rows should be treated as empty, not preserved.
Edge cases to know about
- A line containing only spaces or tabs (visually blank, but not technically an empty string) is still detected and removed as a blank line — the tool checks for "only whitespace," not literally zero characters.
- If you're trying to preserve intentional double-spacing between sections (for example a style guide that calls for two blank lines between major sections and one between subsections), the "collapse to one" mode will flatten that distinction — you may want the "remove all" mode and then manually re-add spacing where needed instead.
- This tool doesn't merge paragraphs the way /remove-line-breaks/ does — removing a blank line here still leaves the surrounding lines as separate lines, just without the blank line between them, which can visually merge what looked like two paragraphs into what now reads as one paragraph without a break, even though the underlying line-break characters within each original paragraph are untouched.
Related tools
FAQ
- How is this different from remove-line-breaks?
- Remove Line Breaks solves mid-sentence hard-wrapping (from PDFs), joining broken sentences back together while preserving paragraph breaks. This tool solves excess or unwanted blank lines between otherwise correctly-formatted blocks of text — a narrower, different problem. They're often used together on messy pasted text, but each targets a different symptom.
- Will this remove a blank line that's meant to separate two paragraphs?
- Only if you choose the "remove all blank lines" mode, which removes every blank line including paragraph separators. The "collapse to one" mode instead keeps a single blank line between blocks, preserving paragraph structure while removing any extra ones beyond that.
- Does a line with just a space count as blank?
- Yes — the tool treats a line as blank if it contains only whitespace characters (spaces, tabs), not only if it's a literal zero-length line. This catches the common case of a line that looks empty but technically has a stray space in it.