GUIDE · SPACING
Cleaning text pasted from PDFs, email and web pages
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:
- Hard line breaks in the middle of a sentence, wherever the source wrapped visually.
- Double or trailing spaces where two copied regions met, or where a line was padded to align.
- Blank lines that separated blocks in the original layout but carry no meaning in plain text.
- Tab characters where the source was a table or an indented list.
- Non-breaking spaces (U+00A0) that look like ordinary spaces but behave differently.
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 | 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.
- Paste the source into the input panel and glance at the counters underneath it.
- Run Clean spacing. Padding, doubled spaces and tabs disappear; line structure survives.
- Run Remove blank lines. Empty rows go, and the paragraph boundaries that mattered are now the ones marked by real text.
- Fix the remaining breaks by hand. Two or three joins are usually enough to restore a readable paragraph.
- 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
- Removing blank lines first. It destroys the paragraph breaks you needed to see, and the result reads as one undifferentiated block.
- Assuming the word count will change. Cleaning spacing removes whitespace, not words, so the word count should be identical before and after. A drop means something else happened.
- Sorting prose. A paragraph that happens to be line-wrapped is not a list, and sorting it scrambles the sentences.
- Copying before reading. The output panel is not saved anywhere. Read it once before you replace your source.
- Expecting typographic fixes. Curly quotes, ligatures such as “fi” and en dashes are character substitutions, not spacing problems, and this tool leaves them alone.
What the tool will not do
- It will not reflow paragraphs into a single continuous line, because it cannot distinguish a wrapped line from a deliberate one.
- It will not strip the
>markers that email replies add in front of quoted text. - It will not convert smart quotes or ligatures into plain characters.
- It will not split or merge entries that contain commas — that is a CSV problem, not a spacing problem.
- It will not repair text that was already lost during the copy. If the characters never made it into your clipboard, no transformation can bring them back.
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.