Copy a paragraph out of a PDF and paste it into a document, an email or a form, and the text rarely arrives as it looked on the page. Lines carry padding spaces at both ends. Gaps between words stretch into runs of three or four spaces. Blank lines pile up between paragraphs. Curly quotes come along for the ride, and invisible characters hide inside words, waiting to break a search or an import.
This guide shows how to clean that pasted text with the free Text Cleaner on Ovatly. It is honest about the split that matters: the cleaner fixes the formatting layer of PDF-copied text, the spacing, the blank lines and the stray characters. It does not repair broken line wraps, and it does not restore words the copy lost. Those are different problems with different fixes.
Contents
- Quick answer
- What PDF copying does to text
- The six cleanups, one by one
- What cleaning cannot fix
- How to clean PDF text, step by step
- Worked example: one paste, three fixes
- Limitations and alternatives
- Common mistakes
- FAQs
- Conclusion
Quick answer
Copy the text out of the PDF and paste it into the Text Cleaner. Tick line trimming, space collapsing, blank line removal and zero-width removal, and add quote normalization if the text is headed for a plain-text target such as a form, a spreadsheet or code. Compare the character counts before and after, then copy the cleaned text out. Do not expect rejoined lines: if every line pasted as its own short line, that wrapping problem belongs to the Remove Line Breaks tool, and missing words come back only with a fresh copy from the PDF.
What PDF copying does to text
A PDF stores text as positioned fragments on a page, not as flowing paragraphs. When you select and copy, your reader reconstructs lines from those fragments, and the reconstruction leaves marks. Spaces that were really just gaps between fragments become real space characters, sometimes several in a row, and justified columns pick up extra spaces spread through the line. The padding before the first word and after the last word of a line often comes along too.
Page structure leaves marks too. A paragraph that flows across a page break can paste with a stack of blank lines in the middle. Headers, footers and page numbers may paste into the middle of your text. Quotes usually arrive as curly typographic quotes rather than the straight quotes plain-text systems expect.
The last category is invisible. Zero-width characters, characters with no width and no visible shape, can ride along from the source document. Two words that look identical then compare as different in a search or an import, and the failure looks mysterious because nothing on screen explains it.
The six cleanups, one by one
The cleaner offers six cleanups, and you tick only the ones you want:
- Line trimming removes the spaces at the start and end of each line, the padding PDF lines carry.
- Space collapsing reduces runs of spaces and tabs inside a line to a single space. It works inside lines only; it never touches the line breaks themselves.
- Blank line removal clears stacks of empty lines, so paragraphs sit at a normal distance.
- HTML stripping removes tags from pasted markup and keeps the text between them. It removes tags only and does not decode entities, so a sequence like
&stays as it is. PDF text rarely needs this one, but text that passed through a web page on its way to you might. - Quote normalization turns curly quotes into straight quotes, and also turns the longer dash characters, the en dash and the em dash, into simple hyphens, which suits plain-text targets.
- Zero-width removal strips the invisible characters out, so words compare and search exactly as they look.
What cleaning cannot fix
Two PDF problems sit outside this tool, and it is worth naming them plainly.
The first is broken line wraps. In many PDFs, every printed line pastes as its own line, so a paragraph arrives as a stack of short lines that break mid-sentence. The Text Cleaner cannot repair that, because space collapsing works inside lines only and the cleaner never joins or removes line breaks. Joining wrapped lines back into paragraphs is the job of the Remove Line Breaks tool. Run that first if your paste is wrapped, then clean.
The second is lost content. If the copy dropped words, merged two columns into one jumbled stream, or skipped text in a scanned image, cleaning cannot restore any of it. A cleanup works on the characters you paste; it cannot invent characters that never arrived. Go back to the PDF and copy the problem section again, in smaller pieces if the columns are confusing the selection.
How to clean PDF text, step by step
- Copy the text from the PDF and paste it into the Text Cleaner.
- If the paste is a stack of short wrapped lines, stop and rejoin the lines first with Remove Line Breaks, then paste the rejoined text here. If the lines are proper paragraphs, continue.
- Tick the cleanups: line trimming, space collapsing, blank line removal and zero-width removal cover most PDF pastes. Add quote normalization for plain-text targets.
- Compare the character counts before and after. A modest drop is normal: it is the padding, the extra spaces and the blank lines leaving.
- Read the result once, quickly, checking that paragraphs survived and no text looks merged or missing. Then copy or download the cleaned text.
Worked example: one paste, three fixes
The tool's own documented example shows the core behaviour. The input is padded: two spaces, the word "Hello", three spaces, the word "world", two more spaces, then four line breaks, then "Next", two spaces, "line". With trim, collapse spaces and remove blank lines ticked, the result is:
Hello world
Next line
Every change is a formatting change. The leading and trailing padding is gone, the three-space gap inside the line is one space, and the stack of four line breaks is a single blank line. No word changed, no word moved, and the line break structure stayed intact.
Limitations and alternatives
Cleaning works on pasted text, one paste at a time, in your browser. Long documents are better handled in sections, because checking the result matters. The cleaner also cannot judge content: it will happily tidy text that is wrong, out of order or badly copied, because it never reads for meaning.
One related caution from the tool's notes: if you ever clean copied page source instead, stripping tags keeps the text between tags, and script and style blocks leave their text behind. Pasted article HTML works best; raw source full of scripts still needs a manual pass.
For wrapped lines, use Remove Line Breaks before cleaning. For finding and fixing one repeated mistake, such as a header that pasted into every paragraph, a find and replace pass after cleaning is the right second step. The wider set of tools in the Text and Writing Tools archive covers those neighbouring jobs.
Common mistakes
- Expecting the cleaner to rejoin wrapped lines. It never touches line breaks. Rejoin first, clean second.
- Cleaning before checking the copy. If the PDF copy dropped a column, cleaning polishes the damage. Read the paste once before you clean it.
- Ticking HTML stripping for plain PDF text. Harmless in most cases, but pointless; tick the cleanups your paste actually needs.
- Skipping the character count check. The before and after counts are your receipt. A huge drop means something more than padding left the text, and you should look before using it.
- Assuming invisible means absent. If a search fails on text that looks right, zero-width characters are a likely cause. Clean and try again.
FAQs
What does the Text Cleaner fix in text copied from a PDF? It fixes the formatting layer: padded lines are trimmed, runs of spaces and tabs inside lines collapse to single spaces, stacks of blank lines are removed, curly quotes become straight ones, and invisible zero-width characters are stripped out.
Can it repair lines that break in the middle of a sentence? No. Broken line wraps are a different problem. The Text Cleaner never touches line breaks themselves; joining wrapped lines back into paragraphs is the job of the Remove Line Breaks tool.
Can it restore words that the PDF copy dropped? No. Cleaning works on the text you paste. If the copy from the PDF lost words, merged columns or skipped a page, no cleanup can invent that text back. Copy that section again from the PDF.
Will cleaning change my wording? No. No cleanup rewords anything. Only spacing, blank lines, tags, quote style and invisible characters are touched, and only the ones you tick.
Is my text uploaded? No. Cleaning happens in your browser on your device.
Conclusion
Text out of a PDF needs two separate judgements: is the content complete, and is the formatting clean? The Text Cleaner handles the second one completely: trimmed lines, single spaces, sane blank lines, straight quotes and no invisible characters, with the character counts to prove what changed. The first judgement stays with you and, where lines are wrapped, with the Remove Line Breaks tool. For the spacing half of the same problem in ordinary text, see the sibling guide: How to Remove Extra Spaces From Text.