Skip to content
Cleaning text

How to Clean Text Copied from PDFs, Word and Web Pages

By the Fakulti team · November 5, 2026 · 7 min read

Advertisement
728 × 90Ad placeholder · article-top-banner

You copy a paragraph from a PDF, paste it into your document and every line ends in the wrong place. Or a web snippet pastes with gaps you cannot delete. These problems come from how files store text, not from anything you did. Once you know the cause, cleaning up becomes a short routine.

Why PDFs break your lines

A PDF is a page-layout format. It records where each line of text sits on the page, not the paragraph it belongs to. When you copy, you receive text line by line, each with its own line break. Words split by a hyphen at the end of a line arrive as two halves, such as “inter-” and “national”. The fix is to rejoin lines within each paragraph while keeping blank lines as paragraph breaks, then repair split words.

The invisible characters in web text

Web pages use non-breaking spaces to stop words wrapping, zero-width spaces to allow wrapping in long strings and soft hyphens to mark hyphenation points. They look like ordinary space or nothing at all, but they behave differently in searches, spreadsheets and databases. A search for “New York” fails if the space is a non-breaking space. Removing or normalising them fixes mysterious mismatches.

Advertisement
728 × 90Ad placeholder · article-in-content

Word processors and “smart” punctuation

Word and Google Docs convert straight quotes to curly ones and double hyphens to dashes. That looks right in a document but can break code, JSON, CSV imports and legacy systems that expect plain ASCII. When a script fails on a line that looks perfectly normal, curly quotes are a prime suspect.

A repeatable cleaning routine

  1. Paste into the Text Formatting Cleaner and choose the preset closest to the source: PDF, web or Word.
  2. Remove invisible characters and collapse repeated spaces, which fixes search and alignment problems.
  3. Fix line structure. For PDFs, rejoin hard-wrapped lines. Skip this for poems, addresses or code where line breaks carry meaning.
  4. Normalise punctuation if the destination is code, a database or an older system.
  5. Strip markup when you copied from an email or HTML source.
  6. Skim the result. Automated cleaning is fast but a quick read catches mistakes such as two paragraphs merged by accident.

Special cases

Tables: copying a table from a PDF often produces one cell per line, with no way to know the column structure; recreate such tables by hand or with a dedicated extraction tool. Columns: two-column layouts may interleave. Copy one column at a time. Scanned documents: if you cannot select the text at all, the page is an image; run it through Image to Text instead. Garbled characters such as “’” indicate an encoding mix-up at the source, which cleaning cannot reliably reverse.

Keep your original

Always keep the unedited text until you have checked the result. If something looks off, undo options one at a time to find the one responsible. With a little practice the whole routine takes under a minute, and you stop retyping text by hand.

Try it: Text Formatting Cleaner

Clean, filter and replace text pasted from PDFs, Word and the web.

Open the tool
Advertisement
728 × 90Ad placeholder · article-bottom-banner

Keep reading