induwara.lk
induwara.lkAI · Machine Translation

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.

By Induwara AshinsanaUpdated Jul 9, 2026
TER Score
One sentence. Stays on your device.0 words
At least one. Stays on your device.0 words
Options
Examples
TER
Rating
Total edits
Reference length

Runs entirely in your browser — your text is never uploaded, logged, or stored. Method: greedy block-shift search plus word-level edit distance, each edit costing one, per Snover et al. (2006); reconciled to sacrebleu --metrics ter. Up to 20,000 characters per box.

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:

  1. 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 sacrebleu TercomTokenizer regexes).
  2. 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).
  3. 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.
  4. 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

Substitution + deletion → 33.33%

Hypothesis
the cat sat on mat
Reference
the cat is on the mat
  1. Align: the=the, cat=cat, is→sat (1 substitution)
  2. on=on, then the reference 'the' is missing (1 insertion)
  3. mat=mat. No block shift reduces the edit distance
  4. Edits = 1 sub + 1 ins = 2 over N_ref = 6
  5. TER = 2 / 6 = 0.3333 → 33.33%

Pure reordering, one shift → 16.67%

Hypothesis
to the school the boy went
Reference
the boy went to the school
  1. The block 'to the school' matches the reference tail
  2. Shift it to the end → 'the boy went to the school'
  3. That equals the reference: 1 shift, 0 residual edits
  4. TER = (1 + 0) / 6 = 0.1667 → 16.67%
  5. Turn shifts off: no monotonic alignment matches both swapped blocks, so all 6 words need editing → 6/6 = 100%

Insertion only → 25%

Hypothesis
she will arrive
Reference
she will arrive tomorrow
  1. she=she, will=will, arrive=arrive (3 matches)
  2. The reference word 'tomorrow' is missing from the hypothesis
  3. That is 1 insertion; no shift helps
  4. N_ref = 4 reference words
  5. TER = 1 / 4 = 0.25 → 25.00%

Frequently asked questions

Sources & references

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

Rate this tool
Be the first to rate

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.