OCR stands for Optical Character Recognition. In plain terms: it is the technology that looks at an image of text and figures out what the characters are.
A scanned document, a photographed sign, a screenshot of an invoice โ these are all images. A computer cannot read text in an image the way it reads text in a Word file. OCR bridges that gap.
A short history of OCR
OCR was first used commercially in the 1950s to read printed characters on bank cheques and postal envelopes. Early systems used physical templates โ a stencil of each character โ and worked only on specific fonts printed in specific sizes.
By the 1990s, software OCR had reached practical accuracy on printed documents. Tesseract, now one of the most widely-used open-source OCR engines, was first developed at Hewlett-Packard in 1985.
Modern OCR uses neural networks. Instead of fixed templates, the model is trained on millions of labelled character images. It learns to generalise โ recognising a character it has never seen in that exact font, size or quality. Accuracy on clean printed documents now exceeds 99.5%.
How OCR works, step by step
1. Image pre-processing
Before recognition begins, the image is prepared:
- Deskew โ straighten a tilted scan
- Deskew โ remove noise (dots, dust marks, folds)
- Binarise โ convert to pure black and white to simplify recognition
- Contrast enhance โ make light text darker for easier reading
A well-prepared image dramatically improves accuracy. This is why scan quality matters.
2. Layout analysis
The engine divides the image into regions: paragraphs, tables, columns, figures. This step determines reading order and prevents text from adjacent columns being mixed together.
3. Character recognition
Each character (or small group of characters) is passed through a classifier. The classifier returns the most likely character and a confidence score. Modern deep learning classifiers use convolutional neural networks.
4. Language model post-processing
The raw character sequence is refined using a language model. If the classifier read "inv0ice", the language model recognises "invoice" is far more probable and corrects it. This step significantly improves accuracy on real-world documents.
5. Output
The result is a text stream with optional position data (bounding boxes for each word or character). Most formats also include per-character confidence scores.
What OCR is used for
Document digitisation โ converting paper archives to searchable digital files.
Invoice and receipt processing โ extracting data for accounting without manual typing.
Identity document reading โ passports, driving licences and ID cards at border control or KYC checks.
Postal automation โ reading addresses on envelopes to route mail.
Accessibility โ converting image-based text to readable text for screen readers.
Licence plate recognition โ reading vehicle plates in car parks, at toll booths and by police cameras.
Book scanning โ Google Books scanned more than 25 million books using OCR.
OCR limitations you should know
Handwriting โ printed text OCR works at 99%+ accuracy. Handwriting OCR is significantly harder. Handwriting varies by person, culture and style in ways printed fonts do not. Modern handwriting OCR (like Google's) achieves 90โ96% on clear handwriting but struggles with cursive and non-Latin scripts.
Low resolution โ below 150 DPI, accuracy drops sharply. Text that is blurry to the human eye is blurry to OCR too.
Complex layouts โ multi-column documents, tables with merged cells, and text over images require layout analysis to get right. Simple engines miss these.
Faded or damaged text โ a water-damaged document or faded thermal receipt may be unreadable by OCR even if partially readable by humans.
Non-Latin scripts โ OCR for Arabic, Hindi, Chinese and other scripts has improved substantially but typically requires a specialised model, not a general-purpose Latin-script engine.
OCR vs AI document extraction
OCR gives you text. AI document extraction gives you data.
The difference: OCR reads "Invoice No: INV-2024-0147" as a string of characters. AI extraction understands that "INV-2024-0147" is the invoice number and stores it in a structured field.
For simple use cases โ making a scan searchable โ OCR alone is enough. For structured data extraction โ turning invoices into spreadsheets, reading bank statements, processing receipts โ you need OCR as the first step, with AI field detection as the second.
ClearDocs combines both: OCR reads the document, and AI maps the extracted text to named fields.