Character error rate

Also known as: CER · OCR accuracy

On this page 7

Character error rate (CER) is the standard metric for text recognition quality, defined as the minimum number of character substitutions, deletions and insertions needed to turn a system’s output into a reference transcript, divided by the number of characters in the reference. In Document AI, CER is the primary way to report OCR accuracy for printed text, handwriting and scene text, and it complements word-level and field-level metrics used in document extraction.

A CER of 0 percent means a perfect transcription, and lower values are better. Because insertions are counted, CER can exceed 100 percent when a system produces much more text than the reference contains, a detail that often surprises newcomers.

How character error rate is calculated

CER is computed from the Levenshtein edit distance between the hypothesis and the reference string. A dynamic programming alignment finds the cheapest sequence of edits, with each operation usually given a cost of one. The formula is CER = (S + D + I) / N, where S, D and I are substitutions, deletions and insertions, and N is the reference length.

The table illustrates the three error types with short examples.

Error typeReferenceRecognized textEdits
Substitutioninvoiceinv0ice1
Deletionamountamout1
Insertiontotaltotall1
Mixed errorsParis 2024Pans 2O243
Error types counted in CER

In the mixed example, “ri” read as “n” counts as one substitution plus one deletion, and the letter O replacing zero is one substitution, so CER is 3 divided by 10, or 30 percent. Corpus-level CER should be computed by summing edits and reference characters across all lines before dividing, not by averaging per-line rates, which overweights short lines.

Some evaluations use weighted edit costs, for example charging less for confusing visually similar characters, but such variants are not comparable with standard CER. A related quantity, character accuracy, is often reported as 1 minus CER; because CER has no upper bound, character accuracy can become negative, so many reports prefer to publish CER directly. When confidence intervals are needed, practitioners usually apply bootstrap resampling over pages or lines, since errors within one page are strongly correlated through shared image quality and layout.

Normalization decisions that change the score

CER is only comparable when text normalization rules are identical. Two evaluations of the same output can differ by several percentage points depending on how whitespace, case and Unicode variants are treated, so careful reports state the normalization explicitly.

ChoiceOptionsEffect on the score
Case sensitivityKeep or lowercaseLowercasing removes capitalization errors
WhitespaceKeep, collapse or removeCollapsing hides spacing errors
Unicode formNFC or NFKCChanges how ligatures and accents count
PunctuationKeep or stripStripping lowers CER on noisy scans
Line breaksCount or ignoreMatters for page-level evaluation
DiacriticsKeep or removeLarge impact on Czech, French or Vietnamese
Normalization choices and their effect on CER

A frequent pitfall is reading order. When a page-level output places two columns in a different order from the reference, CER rises sharply even if every character is correct. For that reason, many benchmarks compute CER per text line or region after alignment.

CER compared with other recognition metrics

CER measures fine-grained transcription quality, whereas downstream tasks often care about whole words or extracted fields. Choosing the right metric depends on how the recognized text is used.

MetricUnit of comparisonBest suited for
Character error rateSingle charactersOCR engines, handwriting, low-resource scripts
Word error rateWhole wordsSearch, readability, speech-like evaluation
Field-level accuracyExtracted valuesInvoice data extraction, form extraction
Exact matchEntire stringIdentifiers, totals, dates
ANLSNormalized similarity per answerDocument question answering benchmarks
Character error rate and related metrics

Word error rate is typically several times higher than CER on the same output, because a single wrong character ruins a whole word. For languages written without spaces, such as Chinese or Japanese, CER is the natural primary metric because word segmentation is itself ambiguous.

Typical values and what they mean

Acceptable CER depends heavily on the material and the use case. Clean printed documents scanned at about 300 dpi can reach CER below 1 percent with modern engines such as Tesseract or transformer-based recognizers, while historical handwriting often remains well above that.

Document typeTypical CER rangeMain error sources
Clean printed textBelow 1 percentRare symbols, ligatures
Receipts and faxes2 to 8 percentLow resolution, thermal fading
Modern handwriting3 to 10 percentWriter variation, connected letters
Historical manuscripts5 to 20 percent or moreAbbreviations, damage, old scripts
Scene text in photosWidely variablePerspective, blur, unusual fonts
Indicative CER ranges by document type

These ranges are indicative rather than fixed, because results depend on training data, image preprocessing such as deskewing and binarization, and the normalization rules in force.

Limitations and common mistakes

CER treats every character error as equally important, which rarely matches business impact. A wrong digit in an amount is far more costly than a missing comma, yet both add one edit.

  • Averaging per-page CER gives short pages too much weight.
  • Ignoring hallucinated text from generative models hides large insertion errors.
  • Comparing CER across datasets with different normalization is misleading.
  • Using CER alone for extraction tasks misses whether the right field was captured.
  • Evaluating on training-like data overstates performance on new document layouts.

Vision-language models and OCR-free document understanding systems make insertion errors more common, since they may paraphrase or complete text. Reporting separate substitution, deletion and insertion counts alongside CER makes such behavior visible.

Put simply

Character error rate tells you how many letters a reading machine got wrong. You count every letter it changed, skipped or added. Then you divide by the length of the correct text.

Imagine a teacher marking a dictation. Each wrong, missing or extra letter costs one point. Fewer mistakes per hundred letters means better reading. A CER of 2 percent means about two errors in every hundred characters.

In practice

A logistics company digitized about 50,000 scanned delivery notes each month and needed to choose between two OCR engines. The team prepared a test set of 500 notes with manually verified transcriptions and applied the same normalization to both outputs: Unicode NFC, collapsed whitespace and case preserved.

Engine A reached a CER of 1.8 percent, and engine B reached 2.6 percent. However, a breakdown by field showed that engine B made fewer errors in tracking numbers, which mattered most. The team selected engine B for numeric fields and combined CER with field-level exact match in its acceptance criteria, which cut manual correction time by roughly a third.