Blog/Text Cleaning

How to Remove Blank Lines in Excel, Word & Online

Blank lines sneak into everything โ€” copy-pasted PDFs, exported spreadsheets, emails, code. Here's how to remove them in every tool you use, plus the fastest one-click solution.

๐Ÿ“… June 2026ยทโฑ 6 min readยท๐Ÿท Text Cleaning, Excel, Word, Productivity

Just want to remove blank lines right now?

Paste your text and clean it in one click โ€” free, no signup, works offline.

Remove Blank Lines โ†’

Why blank lines appear in the first place

Blank lines are almost always caused by copying text from one place to another. PDFs add extra line breaks between paragraphs. Spreadsheet exports add empty rows. Email clients add spacing. Web pages add structural whitespace that becomes blank lines when pasted as plain text.

The result is always the same โ€” your text has random gaps that break formatting, mess up data imports, and make content look unprofessional. Here's how to fix it in every common tool.

โšก

Fastest method โ€” free online tool

The quickest way to remove blank lines from any text โ€” no matter where it came from โ€” is to use ScrambleFix's Remove Blank Lines tool. It handles any length of text, runs entirely in your browser, and works offline.

How to use it:

  1. 1Go to ScrambleFix โ†’ Remove Blank Lines
  2. 2Paste your text into the input box
  3. 3Click Run (or press Ctrl + Enter)
  4. 4Copy the clean output
Try Remove Blank Lines free โ†’
๐Ÿ“Š

Remove blank lines in Excel

There are two ways to remove blank rows in Excel:

Method 1 โ€” Go To Special (fastest)

  1. 1.Select the entire column or data range
  2. 2.Press Ctrl + G to open Go To dialog
  3. 3.Click Special โ†’ select Blanks โ†’ click OK
  4. 4.All blank cells are now selected
  5. 5.Right-click โ†’ Delete โ†’ Entire Row

Method 2 โ€” Filter and delete

  1. 1.Click any cell in your data
  2. 2.Go to Data โ†’ Filter
  3. 3.Click the dropdown arrow on your column
  4. 4.Uncheck everything except Blanks
  5. 5.Select all visible rows and delete them
  6. 6.Remove the filter

Excel formula to check for blank rows

=COUNTA(A1:Z1)=0

Returns TRUE for completely blank rows โ€” use with filtering.

๐Ÿ“

Remove blank lines in Microsoft Word

Word's Find & Replace can remove blank lines using paragraph marks:

  1. 1.Press Ctrl + H to open Find & Replace
  2. 2.In Find what: type ^p^p (two paragraph marks)
  3. 3.In Replace with: type ^p (one paragraph mark)
  4. 4.Click Replace All
  5. 5.Repeat until no more replacements are made

๐Ÿ’ก Tip: If blank lines persist after replacing, they may contain spaces. Use ^p ^p (with a space) in the Find field as well.

๐Ÿ“„

Remove blank lines in Google Docs

Google Docs has a similar Find & Replace approach:

  1. 1.Press Ctrl + H to open Find & Replace
  2. 2.Check the box for Regular expressions
  3. 3.In Find: type \n\s*\n
  4. 4.In Replace with: type \n
  5. 5.Click Replace All
๐Ÿ’ป

Remove blank lines in VS Code

VS Code supports regex in Find & Replace โ€” the most powerful option for developers:

  1. 1.Press Ctrl + H to open Find & Replace
  2. 2.Click the .* icon to enable regex mode
  3. 3.In Find: type ^\s*$\n
  4. 4.Leave Replace empty
  5. 5.Click Replace All

The regex explained:

^Start of line
\s*Zero or more whitespace characters
$End of line
\nThe newline character itself
๐Ÿ

Remove blank lines with Python

For bulk processing or automation, Python is the cleanest solution:

Simple one-liner

# Remove all blank lines from a string
text = "\n".join(line for line in text.split("\n") if line.strip())

Process a file

with open("input.txt") as f:
    lines = f.readlines()

clean = [line for line in lines if line.strip()]

with open("output.txt", "w") as f:
    f.writelines(clean)

Using regex

import re
clean = re.sub(r'\n\s*\n', '\n', text)

Which method should you use?

MethodBest forSpeed
ScrambleFix online toolAny text, any sourceโšก Instant
Excel Go To SpecialSpreadsheet dataโœ… Fast
Word Find & ReplaceWord documentsโœ… Fast
Google Docs regexGoogle Docsโœ… Fast
VS Code regexCode filesโœ… Fast
Python scriptBulk/automated processing๐Ÿ”ง Setup needed

Remove blank lines in one click

Paste any text โ€” from any source โ€” and get clean output instantly. Free, no signup, works offline.

Try Remove Blank Lines Free