TER Score Calculator (Translation Edit Rate)
Paste a hypothesis and one or more references to get the Translation Edit Rate — the fraction of reference words you would have to edit — with a full insertion, deletion, substitution, and shift breakdown plus a word-level alignment. Lower is better. Matches sacrebleu, no signup, runs in your browser.
How it works
TER (Translation Edit Rate) estimates how much work it would take to turn a machine hypothesis into a correct human reference. Unlike overlap metrics such as BLEU or chrF, it is an error rate, so a lower number is better and 0% is a perfect match. It was defined by Snover et al. (2006) and is the metric the tercom and sacrebleu tools compute. The formula is:
TER = (I + D + S + Sh) / N_ref
where I is insertions, D deletions, S substitutions, Sh shifts, and N_ref the number of reference words. Every edit costs exactly one — including a shift of a contiguous block of any length. It is computed in four steps:
- Tokenise and normalise.Both strings are split on whitespace into word tokens. With the defaults, text is lowercased and punctuation is separated into its own tokens, following tercom's normalisation (the exact
sacrebleuTercomTokenizer regexes). - Greedy shift search. The tool repeatedly looks for a single shift — moving a contiguous hypothesis block that exactly matches a reference word sequence to a new position — that most reduces the plain word-level edit distance. The best-improving shift is applied, counted as one edit, and the search repeats until no shift reduces the distance. With Count shifts off, this step is skipped, giving a plain edit rate (the same idea as Word Error Rate).
- Residual edit distance. After shifting, the remaining insertions, deletions, and substitutions are counted with a standard Levenshtein alignment between the shifted hypothesis and the reference.
- Score.Add the shift count to the residual edits and divide by the reference length. With several references, each is scored independently and the minimum (best) TER is reported, normalised by that reference's length — matching tercom's multi-reference behaviour.
Because finding the truly minimal edit sequence with shifts is computationally hard, TER uses this greedy heuristic, exactly as the reference implementations do. As a safeguard, the residual edit count is derived two independent ways — the dynamic-programming distance and a tally of the aligned operations — and the score is flagged “cross-checked” only when they agree. The numbers reconcile with sacrebleu --metrics ter when tokenisation and case settings match.
Worked examples
Frequently asked questions
Sources & references
- Snover, Dorr, Schwartz, Micciulla & Makhoul (2006) — A Study of Translation Edit Rate with Targeted Human Annotation (AMTA)
- tercom v0.7.25 — the reference TER implementation (normalisation and greedy shift search)
- sacrebleu — modern TER implementation reconciled against (sacrebleu --metrics ter)
The formula and the worked examples on this page were last reconciled by hand and against sacrebleu --metrics ter on 2026-07-09. The calculation module ships with a built-in assertion that re-runs every worked example, so a regression in the TER math fails fast.
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.