Look at a scanned contract on your screen and you see words. Your computer sees a grid of pixels. Ask it to find the word “indemnify” and it can’t, because as far as the file is concerned there are no words on the page, only a picture of some.
Optical character recognition bridges that gap. OCR software looks at an image, works out where the text is, decides which character each mark represents and writes those characters out as real text. Done well, it makes a stack of scanned paper as searchable as a document typed yesterday.
A short history#
The idea is old. Early reading machines in the mid-twentieth century recognized a few typefaces designed for the purpose, and the reading machines Ray Kurzweil built for blind readers in the 1970s could handle ordinary print.
Much of today’s open-source OCR descends from Tesseract, an engine developed at Hewlett-Packard’s labs between 1985 and 1994. HP released it as open source in 2005, and Google sponsored its development from 2006. Version 4, released in 2018, added a neural network engine that reads whole lines of text at a time and expanded support to more than 100 languages. Version 5 followed in 2021.
Commercial OCR in scanners, PDF software and cloud services has followed a similar path, from matching letter shapes to neural networks trained on millions of lines of text.
How OCR works, step by step#
Every OCR system follows roughly the same sequence. Each step can fail, and a failure early on spoils everything after it.
1. Getting the image#
It starts with the scan or photo. Resolution matters most. Federal rules for digitizing modern paper records call for at least 300 pixels per inch, and that is the usual floor for good OCR. Below it, letters lose the detail that separates an “e” from a “c.”
2. Cleaning up the image#
Before reading anything, the software prepares the page:
- Deskewing straightens a page that went through the scanner at an angle.
- Rotation detection turns a page scanned sideways or upside down the right way up.
- Binarization converts the image to pure black and white, deciding for each pixel whether it belongs to ink or paper. Faded text and stained paper make this hard.
- Despeckling removes dust, specks and scanner noise.
- Border removal crops the dark edges a scanner leaves around a page.
3. Finding the text#
Next comes layout analysis, which works out where the text is and in what order to read it. The software separates text from pictures, finds columns, splits blocks into lines and lines into words. It has to decide that a two-column page reads down the left column before the right, that a caption belongs to a photo, and that a table is a grid rather than a paragraph.
Layout analysis causes many of the errors people blame on recognition. If the software reads straight across two columns, every word can be recognized correctly and the result is still nonsense.
4. Recognizing the characters#
Older OCR engines isolated each character and compared its shape against stored patterns or measured features like loops, lines and corners. That approach struggles when letters touch, break apart or appear in an unfamiliar font.
Modern engines use neural networks that look at a whole line of text at once and output the most likely sequence of characters. Because they see each letter in context, they handle touching letters and varied fonts far better. Tesseract’s version 4 engine uses this kind of network, called an LSTM, which is designed for sequences.
5. Checking against language#
The raw output is then checked against what the language allows. A dictionary or language model can tell that “rnodern” is probably “modern,” because the letters “r” and “n” side by side look like an “m” in many fonts. This step improves accuracy a great deal for common languages and can hurt it for names, technical terms and languages the model wasn’t trained on.
6. Writing the output#
Finally, the software writes the result. It can produce plain text, a Word file, or a searchable PDF that keeps the original page image and places an invisible layer of text exactly behind each word. That last option is usually best for records, because the page looks exactly as scanned and the words can still be searched and copied.
What accuracy figures mean#
OCR vendors often quote character accuracy, such as 99 percent. That sounds close to perfect until you do the arithmetic. A typical full page of text holds around 2,000 to 3,000 characters, so 99 percent accuracy means 20 to 30 wrong characters per page, enough to break several words.
Word accuracy is a more useful measure for search, because one wrong letter means the whole word won’t match. For important records, the questions to ask are how often key terms such as names, dates and amounts come out right, and how easily a person can find and fix the errors.
What makes OCR go wrong#
These are the most common causes of poor results, roughly in order of how often they cause trouble:
| Problem | What happens | What helps |
|---|---|---|
| Low resolution | Letters blur together | Scan at 300 ppi or more |
| Skewed or rotated pages | Lines are misread or merged | Straighten pages; use automatic rotation |
| Faded, stained or low-contrast originals | Binarization drops or invents strokes | Scan in grayscale; raise resolution |
| Multi-column layouts and tables | Text is read in the wrong order | Use an engine with good layout analysis; check tables by hand |
| Unusual or decorative fonts | Characters are confused | Choose a newer neural engine |
| Stamps, signatures and handwriting over text | Marks are read as letters | Expect manual review on these pages |
| Accents and special letters | Diacritics are dropped or replaced | Set the correct language; check output |
| Phone photos | Uneven light, curved pages, perspective | Flatten the page and shoot straight on in even light |
Language settings matter more than most people expect. If a document contains Igbo, Yoruba or French, telling the OCR engine so lets it expect letters like ọ, ụ, é and è. Without it, those letters are often read as plain vowels or as stray marks.
OCR, handwriting and AI document tools#
Three related technologies are often confused.
OCR reads printed text and is mature, fast and reliable on clean scans.
Handwritten text recognition reads handwriting. It has improved a great deal with neural networks, and its accuracy still depends heavily on how neat the writing is and whether the model was trained on similar hands.
AI document understanding goes a step further, using OCR output plus a language model to pull out fields like invoice totals, dates and party names. These tools are useful and can make confident mistakes, so check extracted figures against the page.
Getting better OCR results#
A few habits improve results more than switching software:
- Scan at 300 ppi for clean print and 400 to 600 ppi for small or faded text.
- Use grayscale for older, faded or stained documents, which keeps detail that pure black and white throws away.
- Remove staples and flatten folded pages before scanning.
- Set the document language before running OCR.
- Keep the original images. You can run better OCR later, but you can’t recover detail from a poor scan.
- Spot-check a sample, especially names, numbers and dates.
Where OCR shows up day to day#
Most people use OCR without noticing. Office scanners and copiers run it when they save a “searchable PDF.” Phone scanning apps run it when they offer to copy text from a photo. Document management systems run it in the background so scanned files appear in search results, and accounting tools run it to read invoices and receipts. Libraries and archives use it to make old newspapers and books searchable.
Each of these runs the same basic steps described above, often with less control over settings. If search results from one of these systems seem unreliable, the cause is usually the scan quality or the language setting rather than the OCR engine itself.
Choosing OCR software#
For occasional use, the OCR built into a scanner or PDF editor is usually enough. For a large archive or difficult documents, compare tools on a sample of your own pages, not on vendor demonstrations. Check how each handles your worst pages, whether it keeps the original image, whether it can produce PDF/A, which languages it supports, and whether files leave your network. For confidential documents, that last question matters as much as accuracy.
How Sabi PDF handles scanned pages#
Sabi PDF checks each page as it opens a file. Pages that already contain real text keep it, and scanned pages are read automatically, with sideways scans turned upright first. You can change that behavior with a reading setting: Automatic, Always (re-read every page) or Never (use only the PDF’s own text). The “searchable scan” export keeps your original pages and makes the text on scanned ones selectable, which is the format most people want for records.
Questions people ask
What does OCR stand for?
Optical character recognition. It is software that finds text in an image, such as a scan or a photo of a page, and converts it into characters a computer can search and edit.
Can OCR read handwriting?
Standard OCR is built for printed text and does poorly on handwriting. Reading handwriting is usually called handwritten text recognition, which uses models trained on handwriting samples. Neat block capitals in forms are easier than cursive.
What resolution should I scan at for OCR?
300 pixels per inch is the usual minimum for ordinary printed documents. Go higher, 400 to 600, for small print, faded originals or damaged pages.
Does OCR change my original scan?
It doesn't have to. A searchable PDF keeps the original page image and adds an invisible text layer behind it, so the page looks the same and the words become selectable.
Sources
Keep reading
This guide is general information for small firms. It is not legal, insurance or compliance advice for your situation.