Skip to main content
Datatool360

What Is OCR, and How Accurate Is It?

By the Datatool360 team ·

You will see the word OCR whenever you work with scans: “this page needs OCR”, “read text with OCR”. It sounds technical, but the idea is simple, and knowing how it works helps you get better results and avoid trusting it too much.

Want to do it right now? Open the PDF to Text tool

What OCR means

OCR stands for optical character recognition. It is a program that looks at a picture of text and works out which letters are in it. The input is an image (a scan, a photo, a page of a PDF that is only a picture). The output is real text that you can select, copy, search and edit.

Think of the difference between a photo of a sentence and the sentence typed in a document. The photo is only dots of colour. OCR turns the dots back into letters.

Why you need it

  • To copy text out of a scanned document.
  • To search a scanned PDF for a word.
  • To edit a scanned page, which is why Edit PDF offers “Read text (OCR)” on pages that have no text.
  • To turn a printed document into a Word file or a text file.

What makes OCR good or bad

OCR is very good on clean input and weak on bad input. The things that matter most:

  • Resolution. A scan of about 300 dpi works well. A small, low resolution picture gives guesswork.
  • Contrast. Black text on a white page is ideal. Faded print, grey paper and coloured backgrounds cause errors.
  • Straightness. A page that is tilted or photographed at an angle is harder to read than a flat one.
  • The font. Normal printed fonts work. Fancy, very small or very bold fonts do not.
  • The language. OCR needs to know the language to guess correctly. The OCR in PDF to Text reads English.
  • Layout. Columns, tables and boxes make the order of the text harder to find.
  • Handwriting. It is not supported by the OCR we use here.

The mistakes OCR makes

Most errors are letters that look alike. The usual ones are 0 and O, 1 and l and I, 5 and S, rn and m, and cl and d. A full stop can become a comma, and a missing accent or a missing small mark can change a word. Because the result looks like clean text, these mistakes are easy to miss.

That is why numbers are the most dangerous part: a wrong digit looks as normal as a right one. Never trust an amount, a date, a phone number or an ID number from OCR without comparing it with the original.

How to get a better result

  1. Scan at about 300 dpi, with the page flat and straight.
  2. Use black and white or greyscale for plain text pages, and make sure that the contrast is good.
  3. Do not use a photo if you can use a scanner. If you must take a photo, use daylight, hold the phone straight above the page and avoid shadows.
  4. Trim the empty edges first, for example with the Crop PDF tool.
  5. Always compare the OCR text with the original, side by side. The PDF to Text tool shows the page next to the text for this reason.

OCR and equations

Normal OCR is built for words. Equations, with their fractions, roots and small numbers above and below, are much harder, and the result of reading a scanned equation is less exact than for a PDF that has real text in it. The Math PDF converter highlights the equations that it had to read from a picture, so you know which ones to check first.

Keep reading