Optical character recognition (OCR) turns an image of text into machine-readable text. It cleans the image, finds the text regions and lines, recognises the characters with a trained model, and records where each word sits on the page. On clean modern print, accuracy is usually very high. On historical archives the results vary widely, from near-perfect to barely usable, so you need to measure accuracy rather than assume it.
This guide explains how an OCR pipeline works and why old newspapers, books and records are difficult. It shows how to measure quality with character and word error rates, and why layout and reading order matter as much as character accuracy. It then compares common engines and output formats, and sets out a practical approach to post-correction and quality-control sampling.
Key takeaways
- OCR quality depends as much on the source and the image as on the engine: microfilm generation, typeface, paper condition and layout all set the ceiling.
- Measure accuracy with character error rate (CER) and word error rate (WER) on a hand-transcribed random sample, because engine confidence scores are not a reliable proxy.
- Reading order and layout errors can make text unusable even when character accuracy looks high, so evaluate layout separately.
- Keep OCR output in a format with coordinates, such as ALTO XML, hOCR or PAGE XML, so text can be highlighted, corrected and reprocessed later.
- Target correction effort where errors cost most, such as headlines, names and dates, rather than spreading it evenly.
How OCR works
A modern OCR pipeline has four stages:
- Preprocessing. The image is converted to black and white (binarisation), straightened (deskewed) and cleaned of noise and borders. The Tesseract documentation notes that its line segmentation degrades significantly if a page is too skewed. It also notes that noise the binarisation step can't remove lowers accuracy. Tesseract 5 added two Leptonica-based binarisation methods, Adaptive Otsu and Sauvola, alongside its default Otsu method.
- Layout analysis. The engine finds text blocks, columns, lines and non-text regions such as illustrations, and decides the order in which to read them.
- Recognition. Each line is passed to a recognition model. Tesseract added a recognition engine based on LSTM neural networks in version 4. Version 5, the current stable major release, began with 5.0.0 on 30 November 2021.
- Output. The engine writes the text along with coordinates, and often confidence values, for blocks, lines, words or characters.
Most engines let you steer layout analysis. Tesseract, for example, has page segmentation modes that tell it to assume a single column, a single uniform block of text, or sparse text found in no particular order. Choosing the right mode for a type of page, such as a card index, a ledger or a newspaper, can make a large difference to the result.
Why historical material is hard
The problems in old documents stack on top of one another:
- Typefaces. Fraktur and other blackletter types, the long s (ſ), historical ligatures and worn or broken type all confuse models trained mainly on modern fonts. That is why specialist training data for Fraktur and early modern print exists, as described below.
- Image source. Many collections are scanned from microfilm, not paper. A 2009 analysis of the National Library of Australia's newspaper programme listed the factors that set the quality ceiling: the quality of the original and of the microfilm, the film generation, scanning resolution, contrast and preprocessing, skew, complex layouts and spacing, marks, mould, fading and poor focus.
- Layout. Narrow columns, adverts, tables, mastheads and articles that jump between pages break simple top-to-bottom reading.
- Language and spelling. Historical spellings, abbreviations and mixed languages on one page defeat modern dictionaries. Our guide to multilingual archives covers language detection.
- Handwriting. Manuscripts, annotations and forms need handwritten text recognition (HTR), which generally requires models trained on similar hands.
The 2009 Australian analysis found that raw, uncorrected OCR on a 45-page sample from 1803 to 1954 scored between 71% and 98.02%. Those figures were the engine's character confidence, not accuracy checked against a transcription. It also reported informal bands agreed with other libraries and contractors: 98–99% counts as good, 90–98% as average, and below 90% as poor. The same study noted vendor claims of 99% accuracy applied only to clean modern material or manually assisted OCR.
Measuring accuracy: CER and WER
The standard metrics come from edit distance: the minimum number of insertions, substitutions and deletions needed to turn the OCR output into a correct reference transcription (the "ground truth").
- Character error rate (CER) = (insertions + substitutions + deletions) ÷ number of characters in the reference.
- Word error rate (WER) applies the same idea to whole words. Any wrong character makes the whole word wrong.
A worked example, using two real error patterns reported in Australian newspaper OCR:
| Text | |
|---|---|
| Reference | the ship sailed from Sydney on Monday |
| OCR output | tlie ship sailed from Sydnoy on Monday |
"the" becomes "tlie" (one substitution plus one insertion) and "Sydney" becomes "Sydnoy" (one substitution). That is 3 character edits over 37 characters, a CER of about 8%. Two of seven words are wrong, a WER of about 29%. WER is almost always higher than CER, and it is closer to what a person searching for "Sydney" experiences.
Three cautions from a 2021 survey of OCR evaluation tools and metrics by researchers including the PRImA group at the University of Salford:
- Confidence is not accuracy. In the survey's experiments, engine confidence had at best a slight correlation with measured CER. The 2009 Australian analysis made the same point: libraries were recording character confidence and calling it accuracy.
- Tools disagree. CER and WER from different evaluation tools can't be compared directly. Tools treat reading order differently and apply different Unicode normalisation, for example to ligatures.
- Errors propagate. The survey reports a 2019 study that added OCR errors to a named-entity dataset: recognition accuracy fell from 90% to 60% as the error rates rose. That matters if you plan to tag people, places and organisations.
Open-source evaluation tools include ocrevalUAtion and the NCSR evaluation tool, both from the EU-funded IMPACT project, and dinglehopper from the Qurator project. Pick one tool and one normalisation policy, and use them consistently across batches.
Layout analysis and reading order
On a newspaper page, high character accuracy is not enough. If the engine reads straight across three columns, every word can be right and every sentence wrong. Layout errors include:
- Merged regions. Two articles, or an article and an advert, end up in one text block.
- Split regions. One paragraph is broken into fragments.
- Wrong reading order. Blocks are emitted in an order a human wouldn't follow.
- Missed text. Captions, marginal notes or small type are not detected at all.
Character metrics largely miss these problems. The 2021 survey concludes that for documents with challenging layouts, metrics that don't capture layout quality are insufficient. Layout evaluation compares detected regions and reading order against ground truth, typically encoded in the PAGE XML format developed by PRImA. ALTO version 4.3 added support for explicit reading-order definitions. For complex pages, budget for checking layout separately from text.
Choosing an OCR engine
There is no single best engine. Test two or three on a representative sample of your own pages.
| Engine | Type | Notable for | Things to test |
|---|---|---|---|
| Tesseract | Open source | Recognises more than 100 languages out of the box. Outputs plain text, hOCR, PDF, TSV, ALTO and PAGE. Models can be retrained | Results depend heavily on preprocessing and the page segmentation mode |
| ABBYY FineReader | Commercial | Used for the National Library of Australia's newspaper programme, as described in the 2009 analysis | How its built-in dictionaries handle your historical spellings and names |
| Transkribus | Platform developed by the READ-COOP cooperative | Handwritten and printed text, with more than 300 community models and the option to train your own. Results available as PAGE XML or ALTO | Whether an existing model matches your scripts and hands |
| Custom-trained models | Any trainable engine | Fraktur, early modern print and other specialist material | Requires line-level ground truth for training and testing |
Specialist ground truth is what makes custom training possible. The GT4HistOCR dataset, for example, provides 313,173 line images paired with transcriptions. It runs from 15th-century incunabula to 19th-century Fraktur. Its authors reported that models trained on it reached character accuracy of about 95% for early printings and 98% for 19th-century Fraktur on unseen test lines.
Dictionaries need testing too. The Tesseract documentation suggests disabling dictionaries if most of your text isn't dictionary words. In the Australian tests, adding a gazetteer of place names as a secondary dictionary produced the worst results of the configurations tried.
Newer vision-language models are also used for transcription. Evaluate them the same way, with CER and WER on your own ground truth, before using them in production.
OCR output formats
| Format | What it is | Key features |
|---|---|---|
| ALTO XML | Library of Congress-maintained standard for layout and text (version 4.4 is current) | TextBlock, TextLine and String elements with positions and sizes. Language attributes, reading order (since 4.3) and character-level Glyph elements (since 4.0). Can store confidence values |
| hOCR | Open standard representing layout analysis and OCR results as a subset of HTML | Classes such as ocr_page, ocr_carea, ocr_par, ocr_line and ocrx_word. Bounding boxes in the title attribute, and an x_wconf word confidence property |
| PAGE XML | PRImA's XML format, widely used for ground truth | Detailed regions, lines and reading order, suited to training and evaluation |
| Searchable PDF | Page image with an invisible text layer | Convenient for readers, but a poor master for text reuse |
Whatever you choose, keep the coordinates. They let a search interface highlight hits on the page image. They also make targeted correction possible and allow reprocessing with a better model later without losing the link between text and image. If you also produce plain text, see our guide to data quality for AI datasets for what downstream teams need.
Post-correction and quality-control sampling
Correcting everything is rarely affordable. A practical QC approach:
- Sample randomly and stratify. Draw random pages or regions from each batch, title or decade, not hand-picked examples. The 2021 survey notes that randomised samples support statistically reliable statements in a way manual selection doesn't.
- Transcribe ground truth carefully. Follow written transcription rules on historical characters, line-end hyphens and abbreviations, so that "errors" are not just convention differences.
- Compute CER, WER and a layout check for each sample, and record the results with the batch.
- Set thresholds by use. Full-text search tolerates more error than named-entity extraction or quotation.
- Weight what matters. The survey points out that an error in a newspaper headline can do more harm to analysis than an error in an advert. In the Australian programme, contractors corrected headings, subtitles and the first four lines of each article to 99.5%.
- Use people where they add most. The National Library of Australia opened OCR correction to the public in 2008. In the first 12 weeks, about 1,200 users corrected 700,000 lines across 50,000 articles.
- Re-run before you re-key. When better models arrive, reprocessing the stored master images is often cheaper than manual correction, provided you kept good masters and coordinates.
Automatic post-correction with language models can fix common confusions, such as "tlie" for "the". Measure its effect on the same samples, because it can also "correct" valid historical spellings and names into modern ones. Our guide to newspaper archive digitisation applies these methods to newsprint.
How Druid Learning helps
Druid Learning is an AI archival processing platform, based in Dublin and New York, that turns content archives into AI-ready datasets. Its Archive Optimization product takes archives in any format and turns them into an indexed, labelled dataset. Supported inputs include OCR scans, PDF, XML, IDML, INDD, SVG, EPUB, WAV, MP3 and MP4. The platform has processed more than 10 million assets and handles content in over 140 languages. For news organisations, its work with NPR covered more than 2 million assets, labelled across eight dimensions and searchable by label.
Frequently asked questions
What is a good OCR accuracy for historical documents?
It depends on the use, but a widely quoted informal benchmark comes from a 2009 study of Australian newspaper OCR. It described 98–99% as good, 90–98% as average and below 90% as poor, while noting there was no agreement on whether those bands meant characters or words. Word accuracy is almost always lower than character accuracy. For full-text search, average quality may be workable. For extracting names, dates and quotations, you'll usually need correction or better models.
What is the difference between CER and WER?
Character error rate counts the insertions, substitutions and deletions needed to turn OCR output into a correct transcription, divided by the number of reference characters. Word error rate does the same for whole words, so a single wrong letter makes the whole word wrong. WER is therefore almost always higher than CER, and it better reflects whether someone searching for a word will find it.
Can I trust the confidence scores my OCR engine reports?
Not as a measure of accuracy. A 2021 survey of OCR evaluation tools found engine confidence had at best a slight correlation with measured character error rate. A 2009 analysis of Australian newspaper OCR warned against calling confidence "accuracy". Confidence can still help rank pages for review. Real accuracy needs comparison against a human-checked transcription of a random sample.
What output format should I keep OCR results in?
Keep a format that stores text together with its position on the page. ALTO XML, maintained by the Library of Congress, is common in libraries and newspaper programmes. hOCR is an HTML-based alternative, and PAGE XML is widely used for ground truth and evaluation. Coordinates let you highlight search hits, correct text in context and reprocess pages later. Plain text alone loses all of that.
Is handwriting recognition the same as OCR?
Handwritten text recognition (HTR) uses similar techniques, recognising whole lines with neural networks, but handwriting varies far more than type. Accuracy depends heavily on having a model trained on similar scripts and hands. Platforms such as Transkribus offer community models for historical scripts and let users train their own from transcribed pages. Expect to invest in ground truth for difficult collections.
Sources
- How Good Can It Get? Analysing and Improving OCR Accuracy in Large Scale Historic Newspaper Digitisation Programs — D-Lib Magazine
- A survey of OCR evaluation tools and metrics (HIP 2021) — Neudecker et al., PRImA Research
- Tesseract Open Source OCR Engine — GitHub
- Improving the quality of the output — Tesseract documentation
- ALTO: Technical Metadata for Layout and Text Objects — Library of Congress
- hOCR - OCR Workflow and Output embedded in HTML, version 1.2 — hOCR specification
- Transkribus — READ-COOP
- Ground Truth for training OCR engines on historical documents in German Fraktur and Early Modern Latin — arXiv