Text ToolsA little help for every day

Search by name or task, such as JSON or percentage.

Text Tools

Remove Empty Lines Online

Delete blank lines from text, including lines holding only spaces or tabs. Remove them all, keep one between paragraphs, or trim only the start and end.

View all tools
ResultUpdates as you type
First line
Second line
Third line

6 blank lines removed, 3 lines kept.

How to use Remove Empty Lines Online

Paste your text and the blank lines disappear as you type. Choose whether to remove every blank line, keep one between blocks or only trim the top and bottom, and optionally strip trailing spaces from each line.

  1. Paste the textPaste code, a list, a CSV export or copied web text with unwanted gaps.
  2. Choose what to doRemove all blank lines, keep one blank line between blocks, or only remove leading and trailing ones.
  3. Copy the resultThe note shows how many blank lines were removed and how many lines remain; press Copy result.

What counts as an empty line

A line with nothing on it is always empty. With Count lines with only spaces or tabs as blank ticked (the default), a line that only looks empty because it holds spaces, tabs or other whitespace counts too, which catches most stray gaps in copied text. Untick it if those lines matter, for example in a fixed-width file. In the sample (First line, an empty line, a line of three spaces, Second line, three empty lines, Third line and a final empty line), Remove all blank lines deletes 6 blank lines and keeps 3.

Remove all or keep paragraph breaks?

Remove all blank lines joins everything into a continuous list, ideal for keyword lists, CSV rows or code you want compact. Keep one blank line between blocks squeezes each run of gaps to a single blank line so paragraphs stay separate: on the sample it removes 4 lines and keeps 5. Only remove leading and trailing blank lines leaves the inside untouched and just cleans the top and bottom. Tick Also trim trailing spaces on each line to remove spaces left at line ends at the same time.

Accuracy and data handling

Before copying the output, check names, punctuation and the intended meaning against the source text. The calculation runs in your current browser; the tool code does not send the input to a processing API.

Often Used Together

Next step

FAQ

How do I remove blank lines from text?

Paste the text with What to do set to Remove all blank lines. Every empty line, including lines with only spaces or tabs, is removed straight away; then copy the result.

Will my paragraphs run together?

Only if you remove all blank lines. Choose Keep one blank line between blocks to keep a single gap between paragraphs while removing the extra ones.

Are lines with only spaces removed?

Yes, by default. Untick Count lines with only spaces or tabs as blank if you only want truly empty lines removed.

More Text Tools

Related tools