How to Extract or Copy Text From a PDF (Free, Even From Scans)

Copy and paste text from any PDF — and what to do when selection fails, the paste comes out garbled, or the PDF is a scanned image.

By PeacefulPDF Team

Getting text out of a PDF is either a five-second copy-paste or a genuine puzzle, and which one you get depends entirely on how the PDF was made. This guide covers the whole ladder: normal copying, the fixes for when copying misbehaves, pulling all the text out at once, and the scanned-document case where there's technically no text in the file at all.

Copy and paste: the normal case

  1. Open the PDF anywhere — your browser is fine.
  2. Click and drag across the text you want. Press Ctrl + A (Mac: Cmd + A) to select everything instead.
  3. Ctrl + C to copy, then paste wherever it's going.

One paste tip that solves most "the formatting came out weird" complaints: paste without formatting — Ctrl + Shift + V in Google Docs and most editors. You get clean text that adopts the destination's styling instead of dragging the PDF's fonts along.

When you can't select or copy the text

Three different problems produce the same symptom, and each has a different fix:

  • The cursor won't select anything at all. The "text" is a picture of text — the PDF is a scan or was exported as images. No selection tool will ever work on it; you need OCR. Jump to the scanned-PDF section below.
  • Selection works, but the paste is garbage — random symbols, letters swapped, words fused together. The PDF's font mapping is broken (common with older generators). Copying will never fix this; extract instead — the tools below read the text layer differently and usually recover it cleanly.
  • Copy is grayed out or blocked. The document has copy restrictions set. If it's your document — or you have the right to use it — our unlock tool removes those permission flags in your browser.

Extract all the text at once

For anything longer than a paragraph or two, stop copying page by page. Our PDF to text tool pulls every word out of the document into a plain text file in one step. It runs locally in your browser — the PDF is never uploaded to a server, which matters when the document is a contract, a statement, or anything else you wouldn't forward to a stranger.

If you want the text with its layout intact — headings, paragraphs, tables — convert to a document format instead: PDF to Word for editing, or use our PDF to Text tool if you just need the raw words. Tables specifically are their own problem; our data extraction tool gets them into CSV without the columns collapsing.

Scanned PDFs: there's no text in there (yet)

A scanned PDF is a stack of photographs. To get text out, something has to read the image — that's OCR. Our OCR tool does it in your browser: it recognizes the text in each page and adds an invisible, selectable text layer, so the file looks identical but now copies and searches like a normal PDF. Then extract or copy as above.

A free alternative worth knowing: Google Drive. Upload the scan, right-click it, Open with > Google Docs, and Google OCRs it into an editable document. It works well, with two caveats — the layout gets loose, and you are uploading the document to Google, which is fine for a recipe and less fine for a medical record.

Other routes that sometimes fit better

  • Microsoft Word: File > Open on a PDF makes Word convert it to an editable document. Good when you were headed to Word anyway; layout fidelity varies.
  • Command line: pdftotext document.pdf output.txt (from the Poppler utilities) is the scripting workhorse — add -layout to roughly preserve columns. Pairs with ocrmypdf for scans.
  • Just need to quote a sentence from a photo of a page? Your phone does this now — iPhone Live Text and Google Lens both let you select text straight from the camera or a screenshot.

The decision in one breath

Selectable text and a short passage: copy-paste. Whole document: extract it. Garbled paste: extract it. Blocked: unlock, then extract. Scan: OCR first, then any of the above.