How to Extract Text from a PDF (Even a Scanned One)

You need to reuse the content of a PDF (a contract, an article, lecture notes) and copy-paste gives you line breaks in the middle of sentences, words glued together or columns mixed up. Or worse, nothing can be selected at all.

First you need to know which kind of PDF you have, because the fix is different.

Does your PDF contain text or an image?

Open the PDF and try to select a single word with the mouse (or long-press on a phone):

  • If the word highlights, it's a native PDF: the text is inside the file and can be extracted directly.
  • If the whole page highlights as one block, or nothing does, it's a scanned PDF: each page is a picture and the text has to be "read" with OCR (optical character recognition).

Native PDF: extract the text to a .txt file

Copy and paste is fine for one paragraph, but painful for long documents: the PDF stores each line separately and those breaks come along when you paste.

The quickest route is converting it to a text file:

  1. Open the PDF to text converter.
  2. Upload the PDF.
  3. Download the .txt file.

The output is UTF-8, so accents and special characters display correctly in any editor (Notepad, Word, Google Docs, VS Code). Keep in mind a .txt is plain text: bold, tables and images are dropped. If you need tables with their columns intact, use PDF to Excel or PDF to CSV instead.

Clean up the text afterwards

Some PDFs (especially two-column layouts) produce broken lines. Word can fix that quickly:

  1. Paste the text and open Find and Replace.
  2. Replace ^p^p with ## (protects real paragraph breaks).
  3. Replace ^p with a space (joins the broken lines).
  4. Replace ## with ^p (restores paragraphs).

Scanned PDF: you need OCR

A PDF to text converter can't read letters inside a photo; that requires OCR. A free option that works well:

  1. Upload the PDF to Google Drive.
  2. Right-click > Open with > Google Docs.
  3. Drive recognizes the text and places it below the image, ready to edit.

It works best with straight, well-lit scans of printed text. With handwriting or poor photos, proofread carefully: OCR easily confuses "l" with "1" or "O" with "0".

Common problems

  • Text comes out in the wrong order: typical of multi-column PDFs or text boxes. Extract to .txt and rearrange the blocks instead of copying piece by piece.
  • Strange characters appear: the PDF uses fonts without a character map. Treat it like a scanned PDF and use OCR.
  • The PDF is password-protected: if copying is disabled, you'll need the owner password. Don't try to bypass protection on documents that aren't yours.