How to Remove Blank Lines From Text Without Joining the Other Lines
To remove blank lines from text, paste it into the Text Cleaner and select Remove empty lines. Each line that contains text stays on its own line; only the gaps disappear. If you are cleaning prose, choose Collapse multiple blank lines to one instead. That keeps one gap between paragraphs and removes the extras.
See the difference before you clean
Before
North entrance
West entrance
···
South entrance
The dots on the fourth gap stand for three spaces. In the real input that line looks empty, but the spaces are still characters. Text copied from a spreadsheet, form or PDF can contain both kinds of blank line.
After: Remove empty lines
North entrance
West entrance
South entrance
The three entries have not been joined into one sentence. The line breaks after “entrance” remain. Only lines with no useful content have gone.
After: Collapse multiple blank lines to one
North entrance
West entrance
South entrance
This second result is useful when the gaps divide paragraphs or groups. The choice is about the gaps, not the words.
Which option should you use?
| Your text | Choose | Result |
|---|---|---|
| One record per line, with accidental empty rows | Remove empty lines | Every record stays on its own line; no empty rows remain |
| Paragraphs separated by several blank lines | Collapse multiple blank lines to one | One blank line remains between paragraphs |
| A poem, transcript or document where gaps carry meaning | Neither until you inspect the structure | You decide which breaks are intentional |
| Sentences broken in the middle by a PDF | The Remove Line Breaks tool | Wrapped lines can be joined while paragraph gaps stay |
For most prose, one empty line is the visible boundary between paragraphs. Deleting it can make the paragraphs harder to recognize even though the individual text lines remain separate. Line breaks and paragraph breaks explains why those are different decisions.
Remove every blank line from a list
- Copy the list and paste it into the Input Text box on the Text Cleaner.
- Leave Collapse multiple spaces and Trim line endings on if the list contains stray spaces. They are part of the General Clean preset.
- Open Advanced Cleaning Options if Remove empty lines is not visible, then tick it under Whitespace.
- Press Clean Text. Check that the number and order of nonempty entries still look right.
- Copy the result or download it as a text file.
The cleaner treats a line made only of spaces or tabs as empty for this option. That matters when a line looks blank but survives a simple search for two consecutive newline characters. If your input is tab-separated data, inspect the result before using Trim each line or Tabs → spaces: tabs can mark empty cells or column boundaries. The guide to removing extra spaces and tabs explains that case.
Do not turn on Join wrapped lines but preserve paragraphs for a list. That option solves a different problem and may turn several list items into one line. Likewise, Remove duplicate lines deletes repeated entries, not blank ones. Use it only when you intend to remove duplicates too.
Keep one gap between paragraphs
Suppose a copied note has two or three blank lines after each paragraph. The General Clean preset already turns each run into one blank line with Collapse multiple blank lines to one. You can leave Remove empty lines off.
Before
The morning shift checks the equipment.
The afternoon shift records any repairs.
After
The morning shift checks the equipment.
The afternoon shift records any repairs.
The paragraph boundary remains visible. If the source has a break at the end of every printed line inside a paragraph, this option alone will not repair the sentences. First read how to join wrapped lines while keeping paragraphs. Its blank-line rule depends on those paragraph gaps still being present.
Check what an “empty” line contains
A line may look empty because it contains spaces, a tab or a character that draws no visible mark. The first two are ordinary whitespace. The Text Cleaner can trim them and remove the line. A zero-width space is different: it can keep an apparently empty line from being recognized as empty until you also select Remove zero-width spaces under Characters.
If a gap unexpectedly remains, put the cursor on the line and check its character count or try the Remove zero-width spaces option, then clean again. Do this deliberately: other invisible characters, including joiners used in some languages and emoji, should not be removed just to chase a gap. The invisible Unicode guide identifies the safe and unsafe cases.
If the result is headed for a spreadsheet, check whether each nonempty line should become a row. Removing blank lines from a list is usually appropriate. Removing them from a pasted table can shift where rows begin, so compare the first few rows with the source before importing.
This guide was drafted with AI assistance. See the editorial policy for how guides are written and corrected.