TodayTools

Remove empty lines

Delete blank lines or keep just one between paragraphs. Ctrl+C copies the result.

PrivateNo uploadsRuns in your browser

Donate
Try an exampleTry:

Recipe

Remove empty lines

Blank lines
Paste text to see what each step removes.
Show

How to remove empty lines

  1. Paste your text

    Paste text, a list or code with blank lines, or open a file.

  2. Remove or squeeze

    Remove takes out every blank line. Keep one leaves a single blank line between paragraphs, so the text still reads well.

  3. Copy the result

    See how many lines were removed, then Copy or Download.

Good to know

  • Lines that hold only spaces or tabs look empty, so they are removed too.
  • Keep one also drops blank lines at the very start and end.
  • Add Tidy spaces before this step to clean the ends of every line as well.
  • Big files are fine. Drop a text file of 50 MB or more: the work happens in the background, the page stays smooth, and Download saves the full result.

Where people use it

  • Text copied from the web

    Pasted text often has big gaps. Remove them in one click.

  • Neat lists

    Turn a gappy list into one item per line.

  • Keep paragraphs readable

    Squeeze many blank lines into one so paragraphs still stand apart.

  • Fix spaces too

    Remove double spaces and tabs next.

    Remove extra spaces and tidy text

Why this one

You can squeeze gaps instead of removing them, so paragraphs keep their shape.

  • Delete all blank lines or keep one between paragraphs.
  • Shows before and after line counts.
  • Works on your device.

What you can change

  • Remove all blank lines
  • Or squeeze many into one
  • Add more clean-up steps

People find this page by searching

  • remove empty lines
  • remove blank lines
  • delete empty lines online
  • remove line breaks
  • remove extra blank lines
  • remove empty rows from text
Cite this tool
  • APA
    sdev.in. (n.d.). Remove empty lines from text [Web tool]. https://www.sdev.in/tools/remove-empty-lines
  • MLA
    "Remove empty lines from text." sdev.in, https://www.sdev.in/tools/remove-empty-lines.
  • Chicago
    sdev.in. "Remove empty lines from text." https://www.sdev.in/tools/remove-empty-lines.
  • BibTeX
    @misc{sdev-remove-empty-lines,
      title = {Remove empty lines from text},
      author = {{sdev.in}},
      howpublished = {\url{https://www.sdev.in/tools/remove-empty-lines}},
      note = {Web tool}
    }

Questions people ask

Does it remove lines that have only spaces?

Yes. A line with only spaces or tabs counts as empty and is removed.

Can I keep the gaps between paragraphs?

Yes. Choose Keep one: many blank lines in a row become one, so paragraphs stay apart.

Will my code indentation change?

No. Only blank lines are removed. Spaces at the start of the other lines are left exactly as they were.

Is my text uploaded anywhere?

No. Every step runs in your browser, on your own device. Nothing you paste or open is sent to a server or kept anywhere except this page.

Donate