Skip to content
OddsockLocal
Local
Source text

Formatting

5 wordsRuns in this browser. Nothing is uploaded.

How to use

  1. Paste the text with its blank lines intact.
  2. Leave the operation on remove empty lines. That is what this page is set to.
  3. Copy the result. Lines that still have words are untouched, padding and all.
  4. Trim or collapse spaces afterward if the surviving lines are still padded.

What is Remove empty lines?

Blank lines are useful in a letter and useless in a list you are about to sort or count. This page deletes a line whose trim is empty: a truly empty line, or a line of spaces and tabs. Lines that contain anything else stay, in the same order, joined with ordinary newlines.

Read more

“Odd socks”, then a line with one space, then an empty line, then “in the dryer.” becomes two lines: Odd socks, then in the dryer. The visual gap is gone. Interior spaces on a kept line are not collapsed, and the ends of a kept line are not trimmed. “ Odd socks ” would survive with its padding, because after a trim it is still not empty.

A paragraph that never had a blank line is unchanged. “Odd socks in the dryer.” is one line in and one line out. This is not the dedupe tool: two identical non-blank lines both stay. It is not the trim tool: padding on a real line stays. A line that holds only a non-breaking space is empty for this test, because the emptiness check trims Unicode whitespace, not just the space bar.

Use cases

  • A developer flattening a stack trace that inserted blank lines between frames.
  • A poet's editor who actually wants the opposite, and uses this only on the mailing list.
  • A data clerk preparing one record per line from a notes app that double-spaces.
  • A student removing the empty rows a PDF-to-text conversion sprinkled through a reading.
  • Someone about to sort a list who does not want blank lines clustering at one end.

A note with a space-only line in the middle

Odd socks\n \n\nin the dryer.

Odd socks in the dryer. The line that held a single space is gone, and so is the fully empty line.

Why use Oddsock

Oddsock runs this in your browser. It is free, it does not upload the work, and it does not ask for an account.

Related tools

Using this tool

Yes. Spaces and tabs trim away to nothing, so that line is deleted. A line with a visible character, even a period, stays.