AI Glossary / AI foundations / Foundation
Optical character recognition (OCR)
Definition
Optical character recognition (OCR) is software that reads text from images, such as scanned pages, photos of receipts and PDFs made from scans, and turns it into machine-readable characters. It is not the same as understanding a document: OCR returns the text it sees, not what the text means. Some vendors use the term loosely to include field extraction and layout analysis.
What it means
A scanned invoice is just a picture. A person can read it, but a computer cannot search it, copy a total from it or check it against an order. OCR closes that gap by converting the pixels of printed or handwritten letters into text a computer can store, search and process.
For a business, OCR is usually the first step in turning paper and image-based files into data. It sits underneath tasks like invoice capture, expense claims, contract search and archive digitization. On its own it gives you a block of text. Further steps are needed to know which number is the invoice total and which is the due date.
How it works
Most OCR tools work in stages. First, the image is cleaned up: it may be straightened, converted to black and white, and cleared of specks and shadows. Second, the software finds the regions that contain text and breaks them into lines, words and individual characters or character groups. Page layout matters here, because a two-column page must be read column by column, not straight across.
Third, a recognition model decides what each shape is. Older systems compared shapes to stored templates of letters in known fonts. Modern systems mostly use trained neural networks that learn from many labeled examples, which lets them cope with varied fonts, slight blur and some handwriting. The model produces its best guess for each character, often with a confidence score.
Finally, a cleanup step uses language knowledge to fix likely errors, for example correcting a word that is not in a dictionary or checking that a date looks like a date. Output is usually plain text, sometimes with position data showing where each word sat on the page. Accuracy depends heavily on input quality: sharp, high-resolution, well-lit images of clean print read far better than crumpled, skewed or faded ones.
Three practical examples
- Finance team: An accounts payable team scans supplier invoices. OCR turns each scan into text, and a later step picks out the supplier name, invoice number and total. A clerk reviews only the invoices the system flags as uncertain.
- Retailer: A store chain lets staff photograph delivery notes with a phone. OCR reads the product codes and quantities so the stock system can be updated without typing them in by hand.
- Support desk: A customer sends a screenshot of an error message. OCR extracts the text from the image so the help desk can search its knowledge base for the exact error code.
Think of it this way
OCR is like a typist who copies a printed page into a word processor without trying to understand it. The typist gets the words down, which makes them searchable and editable. The analogy stops working because OCR can make mistakes a careful typist would not, such as reading a 5 as an S, and it has no sense of whether the result makes sense unless another step checks it.
Worked example
A small firm scans 2,000 pages of supplier paperwork. Each page has about 400 characters of text, so there are 2,000 x 400 = 800,000 characters in total. The OCR tool reports 99 percent character accuracy. That sounds high, but 1 percent of 800,000 is 8,000 wrong characters.
Now look at one invoice total. A total such as 1,284.50 has 7 characters. If each character is read correctly with probability 0.99, the chance all 7 are right is about 0.99 x 0.99 x 0.99 x 0.99 x 0.99 x 0.99 x 0.99, which is roughly 0.93, or 93 percent. So about 7 in every 100 totals would contain at least one error, even with 99 percent character accuracy. This is why the firm adds a check that the line items add up to the total and sends mismatches to a person.
Illustrative case study
Fictional case: Harbor Lane Property Services, a made-up building maintenance company, had a shelf of paper work orders going back ten years. The office manager bought an OCR tool to make them searchable. At first, searches missed many orders. The cause was that the oldest pages were faded photocopies, and the scans had been saved at low resolution, so the tool misread many part numbers. The team re-scanned the faded pages at a higher resolution, added a step to flag any page where the tool's confidence was low, and had one person check a sample of 50 pages each month. Search results improved, and the team kept the sample check running to catch new problems early.
Common misconceptions and mistakes
OCR is 100 percent accurate on any document. Accuracy depends on scan quality, fonts, layout and handwriting, and even small error rates add up across large volumes, so checks are still needed.
OCR understands what a document says. It only converts images of characters into text, so a separate step is needed to find fields like totals or dates or to interpret meaning.
OCR can reliably read all handwriting. Neat block handwriting can work reasonably well, but cursive and messy writing remain hard, and results vary a lot between tools.
Once a document has been through OCR, the text can be trusted without review. Recognized text can contain subtle errors such as swapped digits, so important figures should be validated against other data or checked by a person.
Business use
To start, pick one document type with clear volume, such as supplier invoices or expense receipts, and test an OCR tool on a few hundred real samples, including the poor-quality ones. Set up a simple review path so uncertain results go to a person. Improve inputs where you can: scan at adequate resolution, keep pages flat and use consistent templates.
Measure character or field accuracy on a sample, the share of documents that pass without human correction, time per document before and after, and the cost of fixing errors that slip through. Costs include software fees (often priced per page), setup and the ongoing time for review. Risks include wrong figures entering financial records, and privacy concerns when documents containing personal data are sent to an outside service, so check where the data is processed and stored.
People also ask
What is the difference between OCR and document AI?
OCR reads the characters on a page and returns text. Document AI usually adds steps on top, such as finding fields, classifying document types and validating values. Vendors use the terms differently, so ask what is actually included.
How accurate is OCR?
It varies widely. Clean, high-resolution printed text can be read very accurately, while blurry, skewed or handwritten pages are much worse. The only reliable answer for your case is to test on your own documents.
Can OCR read handwriting?
Some tools can read neat handwriting reasonably well, but results are less consistent than for print. Plan for human review where handwriting is common.
Check your understanding
In the worked example, why do 99 percent character accuracy and a 93 percent chance of a correct total both appear?
Answer: Errors compound across characters. A 7-character total needs every character right, and 0.99 multiplied seven times is about 0.93.
What does OCR output, and what does it not tell you?
Answer: It outputs text recognized from an image, sometimes with position and confidence data. It does not tell you what the text means or which value is, say, the invoice total.
What helped Harbor Lane Property Services improve its search results?
Answer: They re-scanned faded pages at higher resolution, flagged low-confidence pages and checked a monthly sample.
Why add a check that line items sum to the total?
Answer: It catches OCR misreads that the recognition step cannot detect on its own, and routes mismatches to a person.
Related terms
- Intelligent document processing (IDP)
- Computer vision
- Machine learning
- Neural network
- Natural language processing
- Data extraction
- Human-in-the-loop
- Intelligent document processing
- Confidence score
Learn next
Try OCR on 20 to 30 of your own documents, including a few poor-quality ones, and note which errors appear. Then read about intelligent document processing to see how field extraction and validation sit on top of OCR, and about human in the loop to design the review step.
More in AI foundations
- On-device AI - On-device AI is artificial intelligence that runs directly on a local device, such as a phone, laptop, tablet, camera, vehicle or factory sensor, instead of...
- Open-source artificial intelligence - Open-source artificial intelligence refers to AI systems released with permissions and materials that enable others to use, inspect, modify and share them.
- Open-weight model - An open-weight model is an AI model whose trained parameters, called weights, are published so that others can download, run and often adapt them on their...
- Overfitting - Overfitting is the failure where a model learns its training data too well, memorizing its noise and accidents along with its real patterns, so it performs...
- Parameter - A parameter is one of the internal settings a model learns from data during training: the dial positions, like the weights on inputs, that together encode...
- Parameter count - Parameter count is the total number of learned numerical values, often called weights and biases, inside an AI model.
Sources
Google, Machine Learning Glossary: https://developers.google.com/machine-learning/glossary IBM, Think topics: https://www.ibm.com/think/topics Goodfellow, Bengio and Courville, Deep Learning: https://www.deeplearningbook.org/ The sources were consulted for general definitions and background on how neural network recognition models work; the examples, analogy, worked example and case study are original educational illustrations. Checked 5 Nov 2026.
Previous: Optical braille recognition Next: Optical flow