Remove Empty Lines

Remove blank and whitespace-only lines while retaining the content of other lines.

Text inputPreview and copyRuns in your browser

Enter your text

Result

How to use Remove Empty Lines

  1. Paste your source text in the input box.
  2. Select Convert to generate the output.
  3. Review the output before copying it.

How it works

Remove blank and whitespace-only lines while retaining the content of other lines. Keep each line whose trimmed content contains at least one character.

Formula or processing rules

Keep each line whose trimmed content contains at least one character.

Worked example

An empty row and a row containing only spaces disappear from between alpha and beta.

Example text lengths in UTF-16 code units
Input · 14
Output · 10
Worked example
MeasureValue
Source textalpha beta
Resultalpha beta

Pros and cons

Pros

Remove blank and whitespace-only lines while retaining the content of other lines. The sample provides an immediate check of the expected output.

Cons

Indentation on nonblank lines remains intact.

Troubleshooting

Check the input format and compare your case with the built-in sample. Indentation on nonblank lines remains intact.

Frequently asked questions

How do I use the text I get back?

Copy the output into the document, list, or compatible tool where you need it.

How does the transformation work?

Keep each line whose trimmed content contains at least one character.

Can I try a sample first?

An empty row and a row containing only spaces disappear from between alpha and beta.

What should I check before using the result?

Indentation on nonblank lines remains intact.

Is my input stored by the tool?

The transformation is computed in the open page. The tool does not save the submitted text.