Remove empty lines and tidy whitespace
Four separate options rather than one “tidy” button, because they are genuinely different jobs: remove blank lines entirely, trim the spaces at each line's ends, collapse runs of blank lines into one, and collapse repeated spaces inside a line. Someone stripping trailing spaces usually wants their paragraph breaks kept, and a single control would quietly take those away. An empty line and a line holding nothing but spaces look identical in most editors, so both count as blank here.
This tool runs entirely on your device. Nothing you type here is uploaded, logged or stored.
Settings
0 characters
or paste above
Result
Enter some text above to see the result.
How to remove empty lines from text
- Paste the text with the blank lines you want gone.
- Tick only the options you actually want: removing blank lines, trimming the ends, collapsing runs, or collapsing repeated spaces.
- Copy the tidied text out.
Questions about removing empty lines
- What counts as an empty line here?
- A line with nothing on it, and also a line holding only spaces or tabs. The two are indistinguishable in most editors, so both are treated as blank.
- Can I keep one blank line between paragraphs instead of losing them all?
- Yes. Turn on the option that collapses runs of blank lines into a single one, and leave the remove-blank-lines option off.
- Will it change the words themselves?
- No. Only whitespace is touched — nothing is reordered, rewritten or re-cased, and the original stays available next to the result.
- How much text can I paste in at once?
- Enough for a long document; past the guard limit the page tells you rather than freezing. The work happens in this tab either way, so nothing is uploaded regardless of size.