TT · TEXT TIDY

GUIDE · SPACING

Cleaning text pasted from PDFs, email and web pages

By ShengFeng · Published 2026-09-23 · Last updated: 2026-10-12

Copy a paragraph out of a PDF, an email or a web page and it rarely lands clean. Sentences break in the middle, spaces double up at the joins, and a stray blank row appears every few paragraphs. The words are usually right — the packaging is wrong. This guide explains where each defect comes from, shows a real before-and-after, and gives the order of operations that fixes the mess in seconds instead of a retyping session.

Where the mess comes from

A PDF is not a flowing document. It stores text as positioned characters on a page, and when you select a column or a page, the copying software has to guess where one visual line ends and the next begins. Its best guess becomes a hard line break in your editor — even where the original sentence ran on. Email clients and word processors add their own quirks on top: quoted-reply markers, non-breaking spaces used to stop awkward wrapping, and indentation carried over from a table cell.

The result is the same short list of defects almost every time:

Before and after

Here is a passage as it typically arrives from a PDF, with leading padding, a doubled space, a trailing space and an empty row:

  The committee met on
Tuesday to review the
draft.   The minutes

were circulated the
following week.  

Running Clean spacing trims every line and collapses each run of spaces or tabs to a single space. Nothing else changes:

The committee met on
Tuesday to review the
draft. The minutes

were circulated the
following week.

The padding is gone and the doubled space is now a single space, but the passage is still six lines and there is still an empty row. Running Remove blank lines next drops the empty row:

The committee met on
Tuesday to review the
draft. The minutes
were circulated the
following week.

Which defect each action fixes

Defect, appearance and the action that addresses it
Defect What it looks like What handles it
Padding and double spaces “draft.   The” Clean spacing — trims each line and collapses runs of spaces
Tabs from a table “Name⇥Role” Clean spacing — a tab counts as whitespace and collapses to one space
Blank rows An empty line between blocks Remove blank lines
Hard line breaks mid-sentence “met on⏎Tuesday” Not automatic — join by hand after cleaning
Repeated entries The same row appearing twice Remove duplicate lines
Wrong order after editing Items out of sequence Sort lines A–Z

The order that works

Order matters more than people expect, because each action uses the current input and replaces the output panel. If you remove blank lines first you lose the only signal that separated paragraphs; if you join lines first, every hard break becomes a space and the double spacing gets baked in before you can collapse it.

  1. Paste the source into the input panel and glance at the counters underneath it.
  2. Run Clean spacing. Padding, doubled spaces and tabs disappear; line structure survives.
  3. Run Remove blank lines. Empty rows go, and the paragraph boundaries that mattered are now the ones marked by real text.
  4. Fix the remaining breaks by hand. Two or three joins are usually enough to restore a readable paragraph.
  5. Copy or download the result, and check the counters once more before you move on.

If the passage is really a list rather than prose, stop before the manual joining step. List operations assume one item per line, so the line structure you have after step three is exactly what deduplication and sorting want.

Common mistakes

What the tool will not do

Sanity-check the result with the counters

Three numbers sit under each panel: characters, words and lines. Cleaning spacing should leave the word count unchanged and may reduce the character count slightly, because collapsing spaces removes characters. Removing blank lines reduces the line count and nothing else. Those three movements are the fastest way to confirm that a transformation did exactly what you asked — and the fastest way to notice when it did not.

Frequently asked questions

Does cleaning spacing join my broken lines back into paragraphs?

No. It trims each line and collapses runs of spaces or tabs, but it never joins two lines together, because it cannot tell a mid-sentence break from a deliberate one. After cleaning, join the remaining breaks by hand.

Will the word count change after cleaning spacing?

It should not. Cleaning spacing removes whitespace, not words. If the word count drops, a transformation other than spacing cleanup was applied, and the result deserves a careful read.

Why is there still a blank line after I remove blank lines?

Because the line is not actually empty. The check removes any line whose trimmed text is empty, so a row of spaces or tabs does disappear; a row containing a zero-width space or a soft hyphen does not, because those are format characters rather than whitespace. Use the character count to confirm, then remove the character itself.

Can it clean text copied from a table?

Partly. Tabs between cells collapse to a single space, so the cells run together into one line. If you need one column per line, that restructuring is manual, or belongs in a spreadsheet.

← All guides