How to Clean Up Text Copied From PDFs and Websites
Writing & text · Published October 17, 2026 · Updated October 24, 2026 · 3 min read
Written by Akinrinmade Michael
Copy a paragraph out of a PDF and paste it into a document, and it often arrives chopped into short lines, with odd spaces and words split across lines. Fixing it by hand takes ages. A few steps clean up nearly all of it.
What the mess looks like
The committee met on Tuesday to review the bud- get for the coming year. Members agreed that o costs must fall
Every visual line became a real line, a word was split by a hyphen, spacing is uneven, and the bullet has turned into a stray letter o. Each of those has a fix.
Why copied text breaks
A PDF stores each line of a page separately, as if it were printed on paper. When you copy, every line end becomes a real line break in your text. Web pages can do the same when text is laid out in narrow columns, and email programs often add line breaks at about 70 characters.
Step 1: join the lines
Use Remove Line Breaks and replace each break with a space. Tick the option to treat several breaks in a row as one, so a blank line doesn't leave a double gap. If the text has real paragraphs, tick Keep paragraphs, and only the breaks inside each paragraph are removed.
Step 2: repair what is left
| Problem | Fix with Find & Replace |
|---|---|
| Words split with a hyphen, like bud- get | Find -\s and replace with nothing. Check real hyphenated words afterward |
| Double spaces | Find \s{2,}, replace with one space |
| Stray bullet symbols | Find the symbol, replace with a dash or nothing |
| Page numbers on their own line | Find \n\d+\n and replace with a line break |
| Curly quotes in a code sample | Replace them with straight quotes |
Find & Replace has a regular expression option for the patterns above. Work on one fix at a time and check the count of changes.
Awkward sources
- Two-column PDFs. Copying can interleave the columns line by line. Select one column at a time.
- Tables. They usually paste as a stream of cells. Copy them into a spreadsheet instead, or retype them.
- Scanned pages. These are pictures. A scanner's text recognition may add odd characters, so proofread numbers carefully.
- Ligatures. Some PDFs store pairs like fi as one character, which can make a search for a word fail. Replace them with the two letters.
Step 3: sort, number and change case
A list copied from a page can be put in order, and repeats removed, with Sort & Dedupe Lines. If you need to point at specific lines in a review or a set of instructions, Add Line Numbers numbers them, and can start at any number. A heading pasted in capital letters is fixed in one click with the Case Converter.
A routine to follow
- Paste the text and join the lines.
- Fix the hyphens, quotes and spaces with find and replace.
- Read it through once, because no tool catches every odd character.
- Check numbers, dates and names against the original.
- Copy the result into your document and apply your own formatting.
Pasting without the mess in the first place
In many word processors, Paste without formatting (often Ctrl+Shift+V or Cmd+Shift+V) drops fonts and styles, though it still keeps the line breaks. For web pages, selecting only the article text, not the whole page, gives you far less to clean.
All of these tools run in your browser, so a confidential document is never uploaded.
Cleaning a long document in sections
For a long document, work chapter by chapter instead of pasting 50 pages at once. A mistake in your replacement pattern is easier to spot in a small piece, and if you ruin a section, you only redo that section. Keep the original file open beside your cleaned text and spot-check the first and last paragraph of each section. Headings, footnotes and captions are the places where join-the-lines rules go wrong, so check those by eye.