Remove Empty Lines
Strip blank and whitespace-only lines to close up gaps.
Text Tools Runs in your browser
How do you remove empty lines from text?
Blank lines vanish, content lines close ranks. Any line that holds nothing, or nothing but spaces and tabs, is deleted; every line with visible characters keeps its text and its relative order. A ten-line paste with four gaps comes back as six tight lines. That’s the whole job, and it beats deleting gaps one keystroke at a time.
How to use the Remove Empty Lines
- 1 Paste gap-riddled text or a sparse export.
- 2 Lines containing only spaces or tabs count as blank too.
- 3 All blanks are cut; content lines shift up in order.
- 4 Copy the compacted result.
What you can use it for
- Compacting double-spaced pasted text.
- Cleaning data exports full of blank rows.
- Removing gaps from copied code or logs.
- Tightening up a list before sorting.
Frequently asked questions
A line looks empty but refuses to go away in my editor. Will it be caught?
Yes. Lines holding nothing but spaces or tabs are treated as blank and removed along with truly empty ones, so no invisible whitespace rows are left behind.
Will my remaining lines get joined together?
No. Each surviving line keeps its own line break. The tool closes vertical gaps; it never merges content.
Does it touch the text inside kept lines?
Not a character. Indentation, trailing spaces and everything else inside a content line come through exactly as pasted.
Related tools
More Text Tools
More tools like this:
All Text Tools