Documents

OCR: How to Turn a Scan or Photo into Text

You have a photo of a book page or a scan of a contract, but you need text you can copy, search and edit. Retyping it by hand is an hour of work; OCR does it in seconds. Let's unpack how a computer "reads" the letters in an image, why it sometimes gets them wrong, and how to get a clean result — right up to a searchable PDF.

A BOOX e-reader showing the text of a classic novel lies on wooden boards
To a human this is just a page of text. For a computer to see letters here instead of pixels, you need OCR. Photo: Pexels

What OCR is in plain English

OCR (Optical Character Recognition) is a technology that turns an image of text into actual text. The key word is "image."

Here's the core of the problem. When you photograph a page or scan a document, the result — to a computer — is just a grid of colored dots. It "sees" dark and light pixels, but it has no idea that this squiggle is the letter "A" and that one is "B." To it, a photo of text and a photo of a cat are equally meaningless: both are just pixels. You can't copy a word from such an image, find a phrase in it, or fix a typo.

OCR solves exactly this: it finds the letters in the image and converts them into real characters — the kind you can select with your mouse, copy, drop into search, and edit. It's essentially a bridge between "a picture of text" and "text."

In short

A scan or photo of a document is an image, not text. OCR "reads" the letters in the image and turns them into editable text. Without OCR, a scanned PDF looks like a document but you can't search it or copy from it.

How a computer "reads" letters

There's no magic here — just a clear chain of steps. In simplified form, OCR works like this:

  • Image preparation. The engine straightens a skewed page, removes noise and shadows, boosts contrast, and usually converts the image to black and white — that makes the letters easier to separate from the background. This stage is called preprocessing, and it's critical to the result.
  • Layout analysis. The program works out where the text is on the page versus images and tables, and splits the text into blocks, lines and individual characters.
  • Character recognition. For each isolated character, the engine compares it to patterns and decides which letter or digit it is. Modern systems use neural networks trained on millions of examples for this.
  • Dictionary check. Finally the result is "tidied up": OCR checks against the language's dictionary and context, fixing obvious errors (for example, "rn" mistaken for "m").

That's exactly why it matters to tell OCR the document's language: with the right dictionary, the engine recognizes text far more accurately than "blind."

A person reading a page of text on a tablet held in their hands
Everything we read on screen as text was originally an image to the machine — until OCR "read" it. Photo: Pexels

The tools: Tesseract, ABBYY, Google

There are many recognition engines, but in practice you'll meet three main players — for different tasks and budgets.

Tesseract is the legendary free, open-source engine developed by Google. It supports over a hundred languages, is accurate on printed text, and underpins a huge number of free OCR apps and online services. Its strength grows noticeably with good image preprocessing.

ABBYY FineReader is paid professional software, known above all for layout preservation: it carefully reconstructs tables, columns and formatting rather than just "pulling out" bare text. It's the choice for anyone who needs a document as output, not a solid wall of words.

Google Docs and online services. If you only need to recognize one or two files and skip installing software, online is easiest. Google Docs has OCR built in: upload an image or PDF to Drive, open it in Docs, and the text is recognized automatically.

An accuracy benchmark

On clean printed text, the leading engines (Tesseract, ABBYY FineReader) deliver around 98–99% accuracy. But that's for a quality scan. On a bad photo the number drops sharply — the source quality decides almost everything.

What accuracy depends on

The big secret of good OCR is simple: the better the source image, the fewer the mistakes. Let's break down what actually affects the result.

  • Resolution. The standard for documents is 300 DPI (dots per inch). At that density, letters are drawn in enough detail for the engine to tell them apart confidently. Below 200 DPI accuracy falls noticeably.
  • Straightness and cleanliness. A skewed page, edge shadows, spots and noise throw recognition off. Straightening and cleaning (that same preprocessing) can raise accuracy by tens of percent.
  • Contrast. Sharp dark text on a light background is ideal. Faint text, or text that blends into the background, is hard for the engine.
  • Type of text. Printed text is recognized excellently; handwriting is noticeably worse and not always reliable.
  • Language. The correct language and dictionary sharply improve results, especially on mixed or non-Latin text.
300DPI — the scan standard for OCR
98–99%accuracy on clean printed text
100+languages in Tesseract
The OCR rule: garbage in, garbage out. Five minutes spent on a good scan saves half an hour of correcting the recognized text.

Searchable PDF: the invisible text layer

OCR has one especially elegant output — the searchable PDF. The idea is brilliant in its simplicity: the engine leaves the scanned page image exactly as it is, but on top of it adds an invisible layer of recognized text, precisely aligned with the letters in the image.

What does that give you? On the surface the document still looks like an ordinary scan — with all its stamps, signatures and original layout. But now you can search for words, select and copy text as if it were a regular electronic document. For archives, libraries and record-keeping this is the gold standard: the look of the original is preserved, and the content becomes searchable.

That's exactly how the services that turn a mountain of scanned paper into a convenient, searchable archive work. And if you need not a PDF but just "bare" text, OCR will hand you that too, ready to paste into an editor or spreadsheet.

Rows of library shelves entirely filled with books and documents
Digitizing and making an entire document archive searchable is one of the main jobs OCR exists for. Photo: Pexels

How to recognize text: step by step

Let's condense it into a practical routine that works with almost any tool.

1

Get a sharp source

Scan at 300 DPI or photograph the text straight, in good light, with no glare or blur.

2

Pick a tool and language

An online service, Google Docs, Tesseract or ABBYY — and be sure to set the document's language.

3

Run the recognition

The engine preps the image, finds the letters and turns them into text or a searchable PDF.

4

Check the result

Skim the text and fix the rare mistakes — especially in names, numbers and terms.

Pull the text out of a document in seconds

Need to extract text from a PDF without retyping? The FormatZ converter turns a PDF into editable text right in your browser — no install, no sign-up.

Extract text from PDF

If a scan is stored as images and you need a full document, our PDF to Word converter and the guide on converting PDF to Word will help. For the format built for scanned books that often goes hand in hand with OCR, read what DjVu is.

OCR (optical character recognition) is a technology that turns an image of text into actual text. To a human, a photo of a document and typed text look the same, but to a computer a photo is just a grid of pixels. OCR finds the letters in the image and converts them into characters you can select, copy, search and edit.
It depends on the task. Tesseract is a free, open-source engine that supports over a hundred languages and is accurate on printed text. ABBYY FineReader is paid software with very strong layout and table preservation. Google Docs and online services are handy when you need to recognize just one or two files without installing anything. On clean printed text they all reach around 98-99% accuracy.
OCR accuracy depends directly on the quality of the source image. A blurry shot, low resolution, a skewed page, noise, shadows and text that blends into the background all make it harder for the engine to recognize letters. Handwriting is recognized noticeably worse than printed text. That's why a good 300 DPI scan under even lighting is many times more accurate than an angled phone photo.
It's a PDF with an invisible text layer, produced by OCR, placed on top of the page image. On the surface the document looks like an ordinary scan, but you can already search for words, select and copy text in it. This format is the gold standard for archives: it keeps the original look of the document and makes its content searchable.
Yes, modern OCR works well with photos too. The key is to shoot the text straight, in good light, with no glare or blur, so the letters are sharp. It helps to straighten and crop the shot before recognition. The closer the photo's quality is to a clean scan, the fewer mistakes recognition will make.