Optical character recognition (OCR)

Optical character recognition is technology that turns images of printed, typed or handwritten text, such as scans and photos, into machine-readable text.

OCR takes a picture of text and returns the text itself. A typical system works in three stages. It first cleans up the image: straightening a skewed scan, removing specks, converting to black and white, and working out the layout of columns, lines and words. It then recognises the characters. Finally it corrects likely mistakes using dictionaries and patterns of which words tend to appear together.

Recognition methods have changed over the decades. Matrix matching compares each character's pixels with stored examples and works best on familiar typefaces. Feature extraction breaks characters into lines, loops and crossings and compares those. Modern engines use neural networks: the open-source Tesseract engine added an LSTM-based recogniser in version 4, and newer neural models such as TrOCR are also used.

The history is long. Around 1914 Edmund Fournier d'Albe built the Optophone, a handheld scanner that played tones for different letters. Ray Kurzweil founded Kurzweil Computer Products in 1974 and on January 13, 1976 unveiled a reading machine for blind people. Tesseract itself was developed at Hewlett-Packard between 1985 and 1994, released as open source by HP in 2005, with Google developing it from 2006 to 2017. It now recognises more than 100 languages under the Apache 2.0 licence.

OCR is never perfect. One study of 19th and early 20th century newspapers found commercial software reading between 81% and 99% of characters correctly. Small character errors add up: a 1% character error rate can become a word error rate of 5% or more without a dictionary to help. Old typefaces cause trouble; the long s is often read as an f. Handwriting is harder still, and is handled by related techniques known as intelligent character and word recognition.

OCR underpins everyday tools, from reading cheques, invoices and passports to number-plate recognition, searchable PDFs, book digitisation and assistive reading tools for blind and partially sighted people. In AI systems it is often the first step before a scanned document reaches a search index or a language model, so any OCR errors are passed straight into the answers built on top of it.

Common questions

What is OCR?

OCR, or optical character recognition, is software that reads text in an image, such as a scan or a photo, and turns it into editable, searchable text. It is used for digitising documents, processing forms and making scanned PDFs searchable.

How accurate is OCR?

It depends heavily on the source. Clean modern print can be read very accurately, but quality falls with poor scans, unusual or old typefaces and handwriting. A study of historical newspapers found character accuracy ranging from 81% to 99% with commercial software.

Can OCR read handwriting?

Partly. Recognising handwriting is much harder than print, and cursive is harder than hand-printed capitals. Specialised methods called intelligent character recognition and intelligent word recognition target handwriting, and accuracy varies widely.

Is OCR a form of AI?

Yes. OCR is a long-standing research area within pattern recognition, computer vision and artificial intelligence, and modern OCR engines are built on neural networks trained on large collections of text images.

Finding more

Search for "OCR accuracy", "handwriting recognition" or "document AI" alongside the kind of documents you work with. Reliable sources include the documentation of engines such as Tesseract, academic studies of OCR on historical collections, and evaluations published by libraries and archives that digitise at scale. Vendor accuracy figures usually come from clean test documents, so test any tool on samples of your own material.

  • Optical character recognitionReferenceHow OCR works, its history from the Optophone to Kurzweil, accuracy figures and applications.
  • Tesseract OCROfficialThe project page for the open-source engine, with its history, LSTM engine, language support and licence.

Working out what this means for your business?

Aileron Shift builds the systems behind this site: AI newsrooms that research, write and publish on their own, marketing automation and WordPress hosting for companies that need to move faster than their competitors.