PDFora
Pricing All tools

How to Extract Text from a Scanned PDF Accurately

If a PDF has a text layer, PDF to Text copies it exactly; if it is a scan, you need OCR. Rotate, deskew and crop the scan first, pick the right language, then choose a searchable PDF for keeping or a .txt file for reuse. Always proofread numbers, because OCR confuses look-alike characters: a 7 read as a 1, or the letter O read as a zero.

Scanned or digital: find out first

Two PDFs can look identical on screen and be completely different inside. A digital PDF, created by "Save as PDF" in an office suite, a web browser or a billing system, stores real characters with their positions. A scanned PDF stores a photograph of each page; the "text" is just pixels shaped like letters. Which kind you have decides which tool you need, so spend thirty seconds checking:

  • Search for a word you can see. Press Ctrl+F (Cmd+F on a Mac) and type a word from the page. No match on a page that plainly contains it means there is no text layer.
  • Try to select a sentence. In a digital PDF the cursor highlights words line by line. In a scan it draws a box around part of the picture, or selects the whole page as one image.
  • Zoom in to 400%. Digital text stays crisp at any zoom. Scanned text turns soft or blocky, and you may see paper texture, specks or a grey edge.
  • Run PDF to Text. Pages that come back blank are images.

Watch for mixed files. A contract may be digital except for a scanned signature page, and many office scanners already add a rough text layer of their own. If PDF to Text returns garbled words for a page that looks clean, the scanner's recognition was poor and running OCR again will usually do better.

PDF to Text or OCR PDF?

The two tools answer different questions. PDF to Text reads characters that already exist. OCR PDF recognises characters in an image, which is slower and never perfect.

PDF to TextOCR PDF
Works onDigital PDFs with a text layerScans, phone photos, image-only PDFs
How it gets the textCopies stored charactersRecognises letter shapes with Tesseract.js
AccuracyExact, as storedDepends on scan quality; needs proofreading
SpeedFast, even for long filesSeveral seconds per page or more
Output.txt fileSearchable PDF or .txt file
Where it runsIn your browserIn your browser

Always try PDF to Text first on anything you did not scan yourself. If it returns clean text, you are done, and the result is more reliable than any OCR could be.

Prepare the scan before you run OCR

OCR accuracy is decided mostly before recognition starts. The Tesseract project, whose engine PDFora runs in the browser, lists the main factors in its guide to improving recognition quality: resolution, skewed lines, dark borders, noise and uneven backgrounds. Most of them can be dealt with in a few minutes.

  1. Fix sideways and upside-down pages. Use Rotate PDF with a page range (for example 3,7-9) to turn only the pages that need it by 90, 180 or 270 degrees. A page read on its side produces nonsense.
  2. Straighten crooked pages. Tesseract's documentation notes that heavy skew seriously harms its ability to split the page into lines. Deskew detects tilts between −6 and +6 degrees in half-degree steps and turns each page level. It rebuilds the pages as images, which is fine at this stage because a scan has no useful text layer yet.
  3. Remove dark margins. Scanner lids leave grey or black strips, and punched holes and staples sit at the edges. The Tesseract guide warns that such borders can be misread as characters. Crop PDF trims the same margin from every side, set in points: the default of 30 points is 30/72 of an inch, about 10.6 mm. Check that the crop does not clip page numbers or marginal notes you need.
  4. Get the contrast right at the scanner. PDFora has no contrast adjustment, so this belongs at capture time. Use the scanner's document or text mode, scan on a white background and avoid shadows when photographing. Faint pencil, carbon copies, faxes and coloured paper are the usual problem cases; rescanning a little darker often helps more than anything done afterwards.
  5. Pick the right language. OCR PDF offers English, Hindi, Spanish and French. The language chooses which of Tesseract's trained data files reads the page, so French read as English tends to lose its accents and misread words, and Hindi read as English fails entirely.

A sensible order is rotate, then deskew, then crop, then OCR, so each step works on a page the previous one has already tidied.

Resolution: what the numbers mean

Tesseract's documentation says it works best on images of at least 300 dpi. PDFora's OCR renders each page at about 144 dpi before recognition, which keeps it fast enough to run on a phone. Here is what that means for text size: a line of 10-point type is 10/72 of an inch tall, which is 20 pixels at 144 dpi, enough for clean body text. A 6-point footnote is only 12 pixels tall at the same setting, and that is where errors creep in. If small print matters, scan it as cleanly as you can and proofread it with extra care, or use desktop OCR software that works at a higher resolution for those pages.

Scanning at 300 dpi is still worth doing. A sharp, clean original survives rendering far better than a blurry, low-resolution phone picture, and it gives you a good archive copy either way.

Searchable PDF or plain text?

OCR PDF can give you either output. Choose by what you will do next.

  • Searchable PDF keeps the original page images and adds an invisible layer of recognised text behind them. The document looks exactly as before, but you can search it, select a sentence and copy it. This is the better choice for records, archives and anything you will send to someone else, because the reader still sees the real page, signatures and stamps included, and can check any word against the image.
  • Plain .txt gives you only the words, page after page, with no layout. Pick it when you want to paste the text into an email or document, edit it, count words, translate it or feed it to a script.

One sequencing trap: Compress PDF turns pages into JPEG images, which removes any text layer. If you need a smaller searchable file, compress first and run OCR on the compressed copy, rather than the other way round.

Proofread the numbers, every time

OCR errors in prose are easy to spot because the sentence stops making sense. Errors in figures are not: a misread digit still looks like a perfectly normal number. These confusions are the most common ones to look out for:

Looks likeMay really beWhere it bites
17, l (lower-case L), IAmounts, dates, reference numbers
08, O, DTotals, account and invoice numbers
O0Postcodes and codes that mix letters and digits
5S, 6Quantities, model numbers
8B, 3Serial numbers, part codes
. (point), (comma)Decimal and thousands separators
mrnNames and words, rather than figures

A practical way to proofread:

  • Search inside number fields for letters. Look for O, l, I, S and B sitting among digits; they are almost always errors.
  • Re-add the totals. If line items no longer add up to the printed total, at least one figure was misread.
  • Compare against the image. With a searchable PDF, select the suspect number and look at the page beneath it. With a .txt file, keep the scan open side by side.
  • Be extra careful with codes. The Tesseract guide notes that its built-in word lists can work against text that is not ordinary words, such as codes and price lists, so reference numbers and product codes deserve a second look.

What OCR still cannot do well

  • Handwriting. Tesseract is built for printed type. Neat block capitals sometimes come through; joined-up handwriting mostly does not. Plan to transcribe handwritten notes by hand.
  • Tables. The text in each cell is usually recognised, but the grid is not. In the output, cells come out as runs of words and numbers on a line, and wide tables may interleave columns. Expect to rebuild the table yourself.
  • Multi-column layouts. Newspapers and journals can have their columns read in the wrong order, especially when the columns are close together.
  • Mixed scripts. Each run uses one language. A Hindi letter with English addresses will have one part read well and the other badly. Run the file once per language and take each part from the run that read it correctly.
  • Stamps, signatures and watermarks. These overlap the text and turn into stray characters or swallow the words under them.
  • Speed. Recognition runs on your device, and the first run also downloads the engine and language data, so a long document on a phone can take minutes.

A short routine that works

  1. Run PDF to Text; if it returns clean text, stop there.
  2. Otherwise rotate, deskew and crop the scan.
  3. Run OCR PDF in the document's language, choosing a searchable PDF for keeping or sharing, or .txt for reuse.
  4. Proofread every name, date, amount and reference number against the page image before you rely on it.

Frequently asked questions

Why does PDF to Text give me an empty file?

The pages are images with no stored characters, which is typical of scans and phone photos. Run OCR PDF on the file instead.

Does OCR change how my document looks?

Not with searchable-PDF output: the original page images stay, and the recognised text sits invisibly behind them. The .txt output contains only the words, with no layout.

Which languages can PDFora's OCR read?

English, Hindi, Spanish and French. Choose the language of the document before running it; a page in a language that is not selected will be read poorly.

Is my scan uploaded anywhere?

No. OCR PDF runs Tesseract.js in your browser. The first run downloads the engine and language data, but your PDF stays on your device.

Can OCR read handwritten notes?

Rarely well. The engine is designed for printed text, so expect handwriting to come out garbled and plan to transcribe it yourself.

Will compressing the PDF afterwards keep the text searchable?

No. Compress PDF turns pages into images, which removes the text layer. Compress first, then run OCR on the smaller file.

Sources

This guide is general information about using PDF files and PDFora's tools, not legal or professional advice. Spotted something out of date? Tell us.