Remove Empty Lines

Remove lines that contain no visible content. A line containing only spaces or tabs is treated as empty and removed.

What this tool actually changes

Each line is tested after trim() is applied only for the emptiness check. Non-empty lines are returned unchanged, so indentation inside meaningful lines is preserved.

Edge cases to know

Whitespace-only lines disappear, but leading or trailing whitespace on non-empty lines remains. Use Trim Whitespace when you also want to normalize those lines.

Example

Input:
alpha

   
beta
  gamma

Output:
alpha
beta
  gamma

Good use cases

Cleaning pasted code fragments, lists, log extracts, generated text, and documentation where blank separators are unwanted.

Workflow tip

Choose the operation that matches your intent. If whitespace is causing unexpected duplicates, normalize it before deduplicating rather than assuming the duplicate operation should ignore formatting.

Frequently asked questions

What counts as empty?

A line is removed when trim() produces an empty string, so spaces and tabs alone are removed.

Does it remove indentation from real lines?

No. Non-empty lines are returned unchanged.

Should I use Trim Whitespace instead?

Use Trim Whitespace when the goal is to remove leading and trailing whitespace from every line.