How to Convert a PDF Image to Text, Free and Locally
September 12, 2026
A PDF is a container, not a format for text. Some pages inside it hold real characters with positions and fonts; others hold nothing but a photograph of a page. They look identical in a viewer, and only one of them can be copied. Converting a PDF image to text means finding the second kind and running optical character recognition on it.
How to tell which kind of page you have
Open the PDF and try to drag-select a line.
- A text cursor appears and words highlight — real text layer. Nothing needs converting; a plain copy will work, though it may come out badly formatted.
- Nothing highlights, or a blue rectangle covers the whole page — the page is an image. This is what needs OCR.
- Text highlights but pasting gives
□□□or the wrong letters — there is a text layer, but its character map is broken, usually from a subsetted font. Copying will never work correctly on this page. Treat it as an image and OCR it.
That third case surprises people. The page is not a scan and not locked; the mapping from glyph shapes back to characters is simply damaged, and no amount of retrying the copy fixes it.
Converting it
Drop the file on copy text from a PDF. Each page is checked independently:
- Pages with a usable text layer are read directly from it — faster and character-perfect, because nothing is being guessed.
- Pages without one are rendered to a bitmap and passed through OCR locally.
- The results are stitched back into one document in page order.
The per-page check matters more than it sounds. Mixed files are common — a digital report with a scanned signature page, a paper with photographed figures, a contract where only the executed page came back through a scanner. A tool that decides “this file is a scan” or “this file is digital” once, for the whole document, gets those wrong in both directions: it either wastes minutes OCRing pages that did not need it, or it silently drops the image-only pages.
If a page looks selectable but the extracted text is garbage — the broken-encoding case above — use Re-extract with OCR to force the image path for the whole file.
What comes out, and what to fix
Two things reliably need attention after converting a scanned PDF.
Repeated headers and footers. Every page of a report carries the document title, a page number, maybe a confidentiality notice. Extracted naively, those lines appear every few hundred words through your text. They are detected across pages and stripped from the combined output, which is the single biggest quality difference between a usable conversion of a long document and an unusable one.
Hard-wrapped lines. PDF stores text as positioned fragments, so a copy often arrives as one word per line, or with every line ending where the column ended rather than where the sentence did. Toggle cleanup to join those back into paragraphs and remove leftover hyphenation. Turn it off if line breaks carry meaning, as in code listings.
Tables from scanned pages go through the same reconstruction as images — select the region and take it as Excel, Markdown or CSV rather than as plain text, which would flatten the columns into spaces.
How long it takes
Text-layer pages are effectively instant. OCR pages take a few seconds each, on your own CPU, because the recognition model is running in your browser rather than on a server. A 200-page scan is genuinely slow — that is the honest trade-off for not uploading it. For a handful of scanned pages inside an otherwise digital document, which is the common case, you will not notice.
Why local matters for this one
Of everything people run through OCR, PDFs are the most sensitive category by a wide margin: contracts, invoices, medical results, bank statements, signed agreements, identity documents. These are precisely the files that should not be uploaded to a free web service in exchange for a text box.
Here, pdf.js parses the file and the OCR model runs inside the tab. The file bytes never go anywhere, and neither does the extracted text. The full reasoning is here.
Getting a better result from a bad scan
If the source scan is poor, the conversion will be too. Rescan at 300 DPI if you have the original — 150 DPI is the usual culprit behind unreadable output. Scan in greyscale rather than aggressive black-and-white thresholding, which eats thin strokes on faded documents. Straighten skewed pages before scanning rather than after.
More on all of this in extracting text from a scanned PDF and 7 ways to get better OCR results.