Remove Empty Lines
Remove Empty Lines normalizes CRLF to LF and removes every line for which trim() is empty. Lines containing only spaces, tabs, or other trim-recognized whitespace are deleted; leading and trailing spaces on nonempty lines remain. Consecutive nonempty lines are joined with LF and paragraph separation is therefore removed when it consisted of blank lines.
Runs locally — files stay on your deviceAre spaces trimmed from nonempty lines?
No.
Blank-line removal differs from line trimming
The trimmed value is used only as a keep/drop test; retained strings are emitted unchanged.
How it works
Lines are filtered by x.trim() truthiness and rejoined with newline.
Key concepts
Whitespace-only counts empty
A tab-only line is removed.
Retained content unchanged
Indentation on nonempty lines remains.
When to use it
- Compact lists with accidental blanks.
- Remove whitespace-only records.
- Prepare one-record-per-line input.
When not to use it
- Do not use when blank lines encode paragraphs.
- Do not expect indentation cleanup.
- Do not expect lone carriage-return handling.
Worked examples
Blank
- Input
a\n\nb- Expected output
a\nb
Empty line removed.
Spaces only
- Input
a\n \nb- Expected output
a\nb
trim is empty.
Indented
- Input
a- Expected output
a
Nonempty line stays exact.
Common mistakes
Destroying paragraphs
Blank separators disappear. Correction: Use only on list-like data.
Expecting trimming
Retained lines keep spaces. Correction: Run Trim Whitespace too.
Assuming record semantics
Multiline records may break. Correction: Use a format-aware parser.
Best practices
- Check whether blank lines carry meaning.
- Preview paragraph structure.
- Apply trimming separately when intended.
Related operations and differences
Add Prefix to Every Line
Choose Add Prefix to Every Line when you need to add the same prefix before every line.; use Remove Empty Lines specifically for remove empty lines.
Add Suffix to Every Line
Choose Add Suffix to Every Line when you need to add the same suffix after every line.; use Remove Empty Lines specifically for remove empty lines.
Capitalize Every Word
Choose Capitalize Every Word when you need to capitalize the first character of every word.; use Remove Empty Lines specifically for remove empty lines.
Character Counter
Choose Character Counter when you need to count Unicode characters in text.; use Remove Empty Lines specifically for remove empty lines.
Extract Email Addresses
Choose Extract Email Addresses when you need to find unique email addresses in text.; use Remove Empty Lines specifically for remove empty lines.
Extract URLs
Choose Extract URLs when you need to find unique HTTP and HTTPS links in text.; use Remove Empty Lines specifically for remove empty lines.
Limitations and privacy
- Blank/whitespace-only line filter only; no indentation trim, maximum-run option, paragraph preservation, format awareness, counts, or lone-CR normalization.
Text is transformed locally in this browser and is not uploaded by the tool.
Frequently asked questions
Are tab-only lines removed?
Yes.
Are nonempty lines trimmed?
No.
Are paragraphs preserved?
Not when blank lines define them.
Is CRLF normalized?
Yes, to LF.