induwara.lk
induwara.lkAI · Machine Translation

chrF Score Calculator (Character n-gram F-score)

Paste a candidate translation and one or more references to get the chrF2 score on the 0–100 and 0–1 scales, the per-order character precision and recall, and the averaged chrP and chrR — so you can see exactly how the number was derived. Matches sacreBLEU, no signup, runs in your browser.

By Induwara AshinsanaUpdated Jul 9, 2026
chrF Score
One sentence. Stays on your device.0 chars
At least one. Stays on your device.0 chars
Char order (N)β
Examples
chrF2
Rating
chrP · chrR
Best reference

Runs entirely in your browser — your text is never uploaded, logged, or stored. Method: character n-gram precision and recall averaged over the effective orders, combined with F-β, per Popović (2015); sacreBLEU default configuration (char order 6, β=2, whitespace stripped). Up to 50,000 characters per box.

How it works

chrF (character n-gram F-score), introduced by Maja Popović at WMT 2015, scores a machine-translation candidate against one or more reference translations using overlapping character n-grams rather than word n-grams. Working on characters makes it tokenisation-independent and gives partial credit for near-miss word forms, which is why the WMT shared tasks recommend it alongside BLEU. It is computed in six steps:

  1. Preprocess. Optionally lowercase, then remove all whitespace from the candidate and each reference. Following the sacreBLEU default, the cat becomes the six-character string thecat.
  2. Count character n-grams.For each order n from 1 to N (N = 6 by default), extract every contiguous run of n characters as a multiset. Hₙ is the total in the hypothesis, Rₙ the total in the reference.
  3. Clip matches. For each distinct n-gram, credit min(count_in_hyp, count_in_ref). Summing gives Mₙ, the clipped match total for order n.
  4. Per-order precision and recall.chrPₙ = Mₙ / Hₙ and chrRₙ = Mₙ / Rₙ.
  5. Average over the effective orders.Only orders where both the hypothesis and reference have n-grams are counted — a 4-character hypothesis has no 5- or 6-grams, so those orders are skipped. With K counted orders, chrP and chrR are the arithmetic means of chrPₙ and chrRₙ over those K orders.
  6. Combine with F-β. chrFβ = (1 + β²)·chrP·chrR / (β²·chrP + chrR). With β = 2 (the default, giving chrF2) recall is weighted twice as heavily as precision. Multiply by 100 for the conventional scale.

The F-β combination is computed directly and then re-derived through its reciprocal (harmonic) form as an independent cross-check; when the two agree the score is flagged “cross-checked”. The configuration — character order 6, β = 2, whitespace stripped, case-sensitive — is the sacreBLEU default described by Post (2018), so a sentence-level score here reconciles with sacrebleu.CHRF under matching settings. Because character order, β and case all change the number, report chrF together with its settings.

Worked examples

One letter off → 28.06

Candidate
the bat
Reference
the cat
  1. Strip whitespace: hyp 'thebat', ref 'thecat' (6 chars each)
  2. chrP₁..₆ = 5/6, 3/5, 1/4, 0, 0, 0 (chrR identical — equal length)
  3. All six orders present in both → K = 6
  4. chrP = 1.683333 / 6 = 0.280556; chrR = 0.280556
  5. chrP = chrR, so chrF2 = chrP = 0.280556
  6. chrF2 = 0.2806 → 28.06 / 100

Truncated hypothesis → 72.57

Candidate
hell
Reference
hello
  1. Strip whitespace: hyp 'hell' (4), ref 'hello' (5)
  2. chrP₁..₄ = 1, 1, 1, 1 (every hyp n-gram is in the reference)
  3. chrR₁..₄ = 4/5, 3/4, 2/3, 1/2; orders 5–6 skipped (hyp too short)
  4. K = 4 → chrP = 1.0, chrR = 2.716667 / 4 = 0.679167
  5. chrF2 = 5·(1·0.679167) / (4·1 + 0.679167) = 3.395833 / 4.679167
  6. chrF2 = 0.7257 → 72.57 / 100

Identical text → 100.00

Candidate
hello world
Reference
hello world
  1. Strip whitespace: both become 'helloworld' (10 chars)
  2. Every n-gram of every order 1–6 matches with equal count
  3. chrP₁..₆ = 1 and chrR₁..₆ = 1 → chrP = chrR = 1.0
  4. chrF2 = 5·1·1 / (4·1 + 1) = 5 / 5 = 1.0
  5. chrF2 = 1.0000 → 100.00 / 100 (chrF is exact for identical text)

Frequently asked questions

Sources & references

The formulas and the worked examples on this page were last reconciled against Popović (2015) and the sacreBLEU chrF default on 2026-07-09. The calculation module ships with a built-in assertion that re-runs every worked example, so a regression in the chrF 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.