Character Error Rate (CER) Calculator
Paste a reference and a model output to get the Character Error Rate, accuracy, and an exact substitution / deletion / insertion breakdown with a colour-coded character diff. Matches jiwer.cer(), runs entirely in your browser — no signup, no upload.
How it works
Character Error Rate is the character-level counterpart of Word Error Rate. It measures how far a predicted text — from an OCR engine, speech-to-text model, or handwriting recogniser — has drifted from the ground truth, counted one character at a time. The definition used here is the one published in the HuggingFace evaluate CER metric and implemented by the jiwer library:
CER = (S + D + I) / N
where S is the number of substituted characters, D the deletions, I the insertions, and N the number of characters in the reference. The calculator produces these four numbers in three steps:
- Normalise.Both strings are lower-cased (unless “case sensitive” is on), runs of whitespace collapse to a single space, punctuation is optionally stripped, and spaces are optionally dropped. This mirrors the default text handling in
jiwerand keeps the comparison fair. - Align.The two character sequences are aligned with minimum edit distance — a full Levenshtein dynamic-programming table with unit cost for every substitution, insertion, and deletion. The table is then backtraced to recover the exact operation sequence, so S, D, and I are counted from a real alignment rather than guessed. This is the same alignment convention used by NIST’s SCTK / sclite scoring toolkit for ASR benchmarks.
- Divide and cross-check.The total error count S + D + I equals the Levenshtein distance between the two strings, so an independent two-row edit-distance routine recomputes that distance and confirms it agrees. Only then is the result marked “cross-checked”. CER is that total divided by N, and accuracy is
max(0, 1 − CER).
Because insertions are counted while the denominator stays fixed at the reference length, CER is unbounded above: a hypothesis far longer than the reference can score over 100%. That is expected behaviour, not a bug — the HuggingFace metric card notes the same. When the reference is empty after normalisation, N is zero and CER is undefined (division by zero); the tool detects this and shows a specific message instead of a silent NaN. Characters are compared as Unicode code points, so Sinhala, Tamil, and emoji are handled — with the caveat that combining characters count as separate code points (grapheme-aware CER is a planned enhancement).
Worked examples
Frequently asked questions
Sources & references
- HuggingFace evaluate — CER metric card (CER = (S+D+I)/N; CER can exceed 1.0)
- jiwer — reference CER/WER implementation and text-normalisation semantics
- NIST SCTK / sclite — minimum-edit-distance S/D/I alignment convention
- Morris, Maier & Green (2004) — WER, RIL, MER and WIL error-rate definitions
The formula and worked examples were last reconciled against the HuggingFace CER metric card and jiwer.cer() on 2026-07-08. Each live result is additionally cross-checked by an independent edit-distance pass shown in the badge above the tool.
Related tools
Comments & feedback
Spotted a bug or want an improvement? Tell us — our team reviews every comment, and good ideas get built. Comments are public and anonymous.
Found a bug, edge case, or want to suggest an improvement?
Email me at [email protected] — most fixes ship within 24 hours.