Remove empty lines from text
Delete the blank lines from your text and keep the lines with content. Everything runs in your browser and nothing is uploaded.
How it works
-
Paste your text
Type or paste the text in the left box, or open a .txt file. No text to hand? Click Example.
-
Instant result
The result appears as you type. Change the options and see straight away what changes.
-
Copy or download
Copy the result with one click, save it as a file or use it as input for a next step.
Example
Line one, an empty line, Line two, a line with only spaces, Line three and so on become four lines of text with no gaps: Line one, Line two, Line three and Line four. The note reports that 4 empty lines were removed.
Keeping one blank line
Tick Keep one blank line between paragraphs when your text has paragraphs. Extra blank lines are removed but one remains between each paragraph, so Line one, a blank line, Line two and so on stay readable.
Where it helps
- Lists and logs with gaps after copying from an app or a terminal.
- CSV and data files where blank rows break an import.
- Code and config files where you want to condense blank lines.
- Text from e-mails, where every line has a blank line after it.
After this, remove doubles with remove duplicate lines or join the lines into one with join lines. To collapse spaces and blank lines together, use normalize whitespace.
Frequently asked questions
What counts as an empty line?
A line with nothing on it. With *Treat lines with only spaces as empty*, the default, a line with just spaces or tabs counts as empty too.
How do I keep paragraphs apart?
Tick *Keep one blank line between paragraphs*. Any run of blank lines is reduced to a single one, so your paragraphs stay visible.
Are empty lines at the start and end removed?
Yes. Blank lines at the end of the text are always removed, and in the normal mode so are those at the start.
How many lines were removed?
The note under the result tells you, for example *4 empty lines removed*.