Blank Line Remover – Strip Empty Lines From Any Text
Text almost never arrives clean. Copy a few paragraphs out of a PDF and every page break leaves a gap behind. Export a list from a spreadsheet and half the rows come through empty. Paste from Word, an email client, or a chat log and you inherit double spacing you never asked for. A blank line remover fixes all of it in one pass, and this one runs entirely in your browser — your text is never uploaded.
What actually counts as a blank line
This is where most quick fixes fail. A truly empty line has nothing between its two line breaks, so any tool can spot it. A whitespace-only line contains spaces, a tab, or invisible Unicode such as a non-breaking space (U+00A0), a zero-width space (U+200B), or a stray byte order mark (U+FEFF). On screen the two are indistinguishable, but a naive line === "" test only catches the first, which is why a find-and-replace of \n\n leaves so much behind. Both classes are detected here, counted separately, and can be switched on or off independently.
Four cleanup modes
Remove all blank lines produces maximally compact output and suits lists, CSV exports, and log files. Collapse multiple blank lines keeps your paragraph structure but caps each run at a number you choose, which is the right choice for prose — one blank line between paragraphs, never four. Trim leading and trailing only tidies the top and bottom of a snippet while leaving interior spacing completely untouched, so a code sample keeps the blank line inside a function body. Remove duplicate blank lines collapses every run down to a single gap in one click.
·, tabs as →, and invisible Unicode as ⍽. The blank-run strip beside it maps the whole document, so clusters of empty lines in a long file are visible at a glance rather than something you scroll to find.Line endings: LF, CRLF, and mixed files
Windows terminates lines with \r\n, while Unix, Linux, macOS, and Git use a bare \n. Get it wrong and a file opens as one unreadable line in Notepad, or a Git diff claims every line changed. The tool detects what your input uses, flags files with a mixture, and by default preserves the dominant convention — or forces LF or CRLF if you need a specific one on the way out.
Whitespace hygiene, duplicates, and re-spacing
Removing blank lines often exposes other problems. Trim trailing whitespace strips the invisible spaces that linger at the end of lines and trigger linter warnings. Trim leading whitespace is deliberately off by default, because stripping indentation destroys Python, YAML, and formatted code — the tool warns you when your input looks indentation-heavy. Duplicate line removal drops repeated entries either consecutively or globally, with an optional case-insensitive match, which turns a messy export into a clean unique list. The re-spacer works in reverse: after cleaning, it can insert a blank line after every N lines so dense output becomes readable again.
Markdown, code fences, and large files
Blank lines inside a fenced code block are usually intentional. Turn on fence preservation and everything between triple-backtick markers is left exactly as written, while the surrounding prose is still cleaned; an unclosed fence is flagged rather than silently swallowing the rest of the document. Files up to 2 MB can be dropped straight onto the input, with a warning above 1 MB that a pass may take a moment.
Reading the statistics
Every pass reports the original and cleaned line counts, blank lines removed, whitespace-only lines removed, duplicates removed, and the overall reduction percentage. Characters and true UTF-8 bytes are shown before and after, so you can see the real size saving on a large file. The longest blank run readout tells you where the worst cluster sat in the source. Results copy to the clipboard in one click, download as .txt or .md, or export as a CSV pairing each cleaned line with its number for spreadsheet import.