Unevenly spaced text lines with a paragraph mark on a soft purple background with the title "Remove Extra Spaces and Blank Lines" — Miss Tricker Tools Text Tools guide.

How to Remove Extra Spaces and Blank Lines from Text in Minutes

Try it now: use our free Remove Extra Spaces to clean your text in seconds.

Introduction

It started with a CV copied out of a PDF. The words were all there, but so was everything else: gaps of three or four spaces in the middle of sentences, a blank line after every single line, and one paragraph that broke in half for no reason at all. The person who sent it was apologising before we had even opened it properly. “Sorry about the formatting,” the message said. “It looked fine in the other file.”

Pasted text misbehaves like this constantly. PDFs are the worst offenders, but text copied from web pages, emails, and old documents does it too. The content is fine. The spacing is a mess, and a messy document quietly makes readers trust the content less. Cleaning it up takes minutes once you know the order to do it in — and the order is the part most people get wrong.

Three kinds of clutter, three different fixes

People say “extra spaces” as if it is one problem. It is usually three, and each needs its own pass.

1. Spaces in the middle of lines

Double spaces after full stops. Three spaces where a tab failed. A trailing space dangling at the end of a line. These come from old typing habits, OCR scans, and pasting between programs that disagree about spacing.

2. Blank lines between paragraphs

Sometimes you want one blank line between paragraphs. Pasted text often arrives with two or three, or with a blank line after every line, which makes a normal page look like a poem nobody asked for.

3. Blank lines inside lists and addresses

A list where every item is followed by a gap reads badly and prints worse. Addresses copied from emails often suffer from this, with a stray empty line between the street and the town.

Treating all three as one job leads to the classic mistake: flattening the whole document into one solid block, then spending longer rebuilding the paragraph breaks than the clean-up was going to take.

The safe order to clean in

Work in this sequence and you will not destroy anything you needed.

  1. Save a copy first. Always. Clean the copy, keep the original untouched until you are happy.
  2. Remove blank lines first, or reduce runs of them down to one. Decide your rule now: one blank line between paragraphs, none inside lists.
  3. Then fix the spaces. Replace double spaces with single spaces, and repeat until no doubles remain — a triple space becomes a double on the first pass, so one pass is not always enough.
  4. Trim the ends of lines. Spaces at the end of a line are invisible and pointless, and they break other jobs later, like matching duplicate lines in a list.
  5. Read it. One quick scroll, looking for anything the passes flattened that should have stayed separate.

A worked example

Start with this, copied from a PDF notice:

The  library  will close early on Friday.   
Staff should return all keys by 4 pm.


New opening hours start on Monday.   

Please check the notice board  for details.

Five minutes of cleaning, in the order above, gets you:

The library will close early on Friday.
Staff should return all keys by 4 pm.

New opening hours start on Monday.
Please check the notice board for details.

Nothing was retyped. The double spaces went, the trailing spaces went, the run of blank lines became one deliberate blank line between the two parts of the notice, and the line breaks that belonged inside each part stayed exactly where they were.

Using find and replace properly

Find and replace is the workhorse here, and it rewards a little patience.

  • To collapse double spaces: search for two spaces, replace with one space, run it repeatedly until the program reports zero replacements.
  • To remove repeated blank lines: most word processors let you search for a paragraph mark. Two paragraph marks in a row means a blank line. Replacing two with one, repeatedly, reduces any run of blank lines to a single break — without touching the single breaks you want to keep.
  • To delete every blank line entirely: replace two paragraph marks with one and keep going until nothing changes, but only do this on lists and blocks where no paragraph gap should survive at all.

Go gently. If the count of replacements looks absurd — thousands in a two-page letter — stop and check what you actually searched for.

One thing find and replace will not do well: tell apart a blank line you want from one you do not. That judgement is yours. A gap before a heading is usually deliberate. A gap between every line of a shopping list is not.

What not to clean

Some spacing is doing a job. Indented code, poetry, tables typed with spaces, and fixed-layout addresses can all depend on exact spacing. A blanket replace-all will wreck them. This is another reason the copy comes first, and why structured text deserves a slower, section-by-section clean.

Watch out for non-breaking spaces too. Text pasted from web pages sometimes uses a special space that looks normal but does not behave like one — find and replace for ordinary spaces can sail straight past it. If a stubborn gap refuses to shrink, that is usually why.

Frequently Asked Questions

How do I get rid of blank lines without losing my paragraph breaks

Reduce them instead of deleting them. Replace double paragraph breaks with a single one, and repeat until no doubles are left. Every run of blank lines becomes exactly one blank line, and paragraphs that were correctly separated stay separated. Deleting every blank line only suits lists, not normal writing.

Why is there still a big gap after I removed the extra spaces

Because gaps between paragraphs are rarely caused by spaces. They are usually paragraph spacing settings, or real blank lines. Check for an empty line first. If there is none, look at the paragraph settings — a “space after paragraph” value can add a gap to every paragraph at once.

Can I clean a whole document in one go, or should I go section by section

A normal letter or article cleans up fine in one go, working in the order above. Go section by section when the document mixes paragraphs with lists, tables, or anything indented, because one blanket pass will flatten something you wanted to keep.

Conclusion

Messy spacing is not a writing problem, it is a pasting problem, and it gives in quickly to a methodical clean: copy first, blank lines before spaces, doubles replaced until none remain, ends trimmed, then one honest read-through. The CV that arrived with an apology did not need rewriting. It needed ten quiet minutes of this.

Related guides

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top