Black October, explainedAppsGuidesAI DictionarySmall FixesOn RecordAboutFollow the lab

OCR

Also called optical character recognition, text from images

OCR, optical character recognition, turns a photo or scan of words into real text you can copy, search and edit.

In plain words

Take a photo of a shop's signboard and the phone number on it is just coloured dots, like any other photo. You cannot copy it or search it. OCR reads the dots and turns them into actual letters and digits, so you can tap the number and call.

It works a bit like a child learning to read. First find where the writing is on the page. Then split it into lines, words and single letters. Then decide which letter each shape is, using what it has learned from many examples of printed and handwritten text.

OCR is part of computer vision. It is behind "copy text from image" on your phone, scanning apps that make PDFs searchable, cheque and form processing at banks, and reading number plates. Modern OCR uses deep learning, so it copes with tilted photos, unusual fonts and many scripts, from English to Devanagari.

Everyday example

Copying a recipe from an old cookbook

You want to send a cousin your favourite recipe from a printed cookbook. Typing it all is slow. You photograph the page, your phone finds the text block, straightens it, picks out each word and turns it into text you can paste into WhatsApp. That is OCR doing in a second what would take you ten minutes.

Where the example breaks: You understand the recipe, so you would notice that "1 tbsp" makes more sense than "l tbsp". Basic OCR only reads shapes, so it can mix up similar ones, like l and 1, or O and 0, especially in blurry or handwritten text.

Go deeper

How it actually works

Classic OCR runs as a pipeline. Modern systems merge some steps inside one neural network, but the jobs are the same.

  1. Clean the image

    The image is straightened (deskewed), contrast is boosted and noise removed. Older systems turned everything into pure black and white first.

  2. Find the text

    Layout analysis separates blocks of text from pictures and tables, then splits blocks into lines and words.

  3. Recognise characters

    Early OCR matched each character against stored templates or measured its features: loops, lines, crossings. Modern OCR uses a neural network that reads a whole line at once. The open-source Tesseract engine added this kind of model in version 4.

  4. Use context to fix errors

    A language model or dictionary checks the result, so "c0ffee" becomes "coffee". Newer vision-language models can read a document and also answer questions about it.

A landmark
1974: Ray Kurzweil's new company built OCR that read any font, and in 1976 a reading machine for blind people
Open source
Tesseract, first built at HP Labs, open-sourced in 2005 and later developed by Google, reads more than 100 languages
Common uses
Document scanning, searchable archives, bank forms and cheques, number plates, translating signs with a phone camera
Close cousin
ICR, intelligent character recognition, for handwriting

Questions people ask

What does OCR stand for?

Optical character recognition. Optical because it works from images, character recognition because it identifies letters, digits and symbols and turns them into text a computer can use.

How do you copy text from a picture on your phone?

Most phones now do OCR built in. On Android, Google Lens lets you select text in a photo or through the camera. On iPhone, the Live Text feature does the same. Select the words, then copy, search or translate them.

Can OCR read handwriting?

Yes, increasingly well, though less reliably than print. Neat handwriting is usually fine. Joined, messy or faded writing still causes errors, so check names and numbers by eye.

Does OCR work for Hindi and other Indian languages?

Yes. The open-source Tesseract engine, for example, has models for Hindi, Bengali, Tamil and other languages, and for the Devanagari script. Accuracy depends on print quality and the script: joined letters and vowel marks make some scripts harder than English.

Is OCR AI?

Modern OCR is. It uses machine learning models trained on huge numbers of text images. Early OCR, from the 1970s and before, used hand-written rules and template matching, which is why it needed clean print and standard fonts.

Further reading