PDF and text

What is OCR?

Short for Optical character recognition. Also called text recognition.

OCR, or optical character recognition, identifies text in images and scans and converts it into characters you can search, copy and edit.

How it works

A scan or photograph stores the appearance of letters as pixels. To a computer, a picture of the word “invoice” is no different from a picture of a tree. OCR analyses the shapes, recognizes them as characters and assembles words and lines.

Accuracy depends on the language, font, contrast and image quality, so extracted text needs review. Modern engines use a language model to prefer real words, which helps with blurred letters but can also “correct” unusual names and codes into ordinary words.

OCR vs text extraction

If a PDF was created from a word processor, it already contains real text, and extraction simply copies it out with perfect accuracy. OCR is only needed when the text exists as an image: scans, photos, screenshots and PDFs made from them. Running OCR on a scanned PDF can add an invisible text layer so the document becomes searchable.

A practical example

OCR can turn a photo of a printed receipt into text you can copy into a spreadsheet. It may confuse the letter O with the digit 0 or l with 1.

What to watch out for

OCR doesn’t guarantee an exact transcription or preserve every layout detail. Check names, numbers and totals, and for a PDF with an existing text layer, direct text extraction is more accurate.

Tools you can use

Go a little deeper

Common questions

How accurate is OCR?

On a clean, straight scan of printed text, accuracy is often above 98 percent. Handwriting, low resolution, unusual fonts, shadows and skewed photos lower it considerably.

How do I get better OCR results?

Photograph the page flat and in even light, crop to the text, make sure the resolution is high enough that letters are clearly formed and choose the correct language.

Can OCR read handwriting?

General OCR engines are built for printed text. Neat block capitals may work; joined-up handwriting usually needs specialized handwriting recognition.

Related terms

Browse the complete file format glossary →