Reliability & agreement

Dice ↔ IoU converter and overlap calculator

Dice and IoU are one overlap under two scalings, so converting between them needs no data. What does need showing is where both mislead: on small structures, and against Cohen's kappa, which moves when you crop the image while these two do not.

Free · No sign-up · Runs entirely in your browser

Convert between Dice and IoU

The two metrics are one quantity under two scalings, so the conversion needs no data at all. Everything below runs in your browser.

One value in

Dice (DSC)

0.667

Dice = 2·IoU / (1 + IoU)

Or build the two masks

Units both masks cover. Capped at the smaller mask.

Total area of the first mask — the prediction.

Total area of the second mask — the reference.

AB
Drawn to scale: circle areas are proportional to |A| and |B|, and the lens is the shared area you entered.

Dice (DSC)

0.818

IoU (Jaccard)

0.692

Union |A ∪ B|

130

10 in A only, 30 in B only

Precision / recall

0.90 / 0.75

Dice is their harmonic mean — it is the F1 score

Why the same mistake scores differently

Each row below makes the identical absolute error — two units missed, two units invented — against a target of a different size. Overlap metrics measure area, so they punish that error on a small structure and forgive it on a large one.

  • Dice 0.800
  • Dice 0.933
  • Dice 0.980
  • Dice 0.993
  • Dice 0.998

The two extremes are the whole argument: a four-unit error costs 0.800 Dice on a 10-unit structure and only 0.998 on a 1,000-unit one. Never compare Dice across structures of different sizes.

Why not Cohen's kappa on pixels

These rows score the same two masks you built above. The only thing that changes is how much empty background the image includes. Dice stays 0.818 and IoU stays 0.692 throughout, because neither one counts the background — kappa does.

Field of viewRaw agreementCohen's κDice / IoU
Full 200×200 slice(40,000 units)0.9990.8180.82 / 0.69
Tight 150-unit window(150 units)0.7330.3330.82 / 0.69
Cropped to the union(130 units)0.692-0.1300.82 / 0.69

Pair overlap with a boundary metric

Every metric on this page measures area, so all of them are blind to where the error sits. A one-voxel rind around a large organ can leave Dice above 0.98 while the contour is systematically wrong. The boundary metrics below need the actual surfaces and the voxel spacing, so this tool cannot compute them — it can only tell you that you need one.

  • Hausdorff distance (HD) — Largest distance from any surface point of one mask to the nearest point of the other, taken symmetrically. 0 to ∞, lower is better. Weakness: One stray voxel far from the object dominates the whole number.
  • HD95 — The 95th percentile of those surface distances instead of the strict maximum. 0 to ∞, lower is better. Weakness: Discards the top 5% of errors, so a small number of genuinely bad points can hide.
  • ASSD — Average symmetric surface distance — the mean boundary error in both directions. 0 to ∞, lower is better. Weakness: Needs voxel spacing, and averages away a localised but clinically important error.

Copies both metrics, the identity check and the caveats — not just the number.

Reference · for the curious

Dice, IoU and the metrics that catch what overlap hides

Dice and IoU are the same measurement under two scalings. They rank results identically, so choosing between them is a question of convention rather than of statistics: IoU is standard in computer-vision benchmarks, Dice dominates medical imaging. The decision that actually matters is not which of the two to report, but whether an overlap metric on its own tells you what you think it does.

The formulas, and the identity between them

Dice (DSC) = 2·|A∩B| / (|A| + |B|) and IoU (Jaccard) = |A∩B| / |A∪B|. They convert exactly: Dice = 2·IoU / (1 + IoU), and inverting it, IoU = Dice / (2 − Dice).

Because the identity is algebraic, the conversion needs no data and introduces no error. It is also monotonic, so a model that wins on IoU wins on Dice. What the identity does not do is make the two numbers interchangeable in a sentence: for any partial overlap Dice is the larger of the two, and the gap is widest in the mid-range, so a bare "0.90" is genuinely ambiguous until you say which metric produced it.

The coefficient itself is older than either field that now argues about it. Dice (1945) introduced it to measure ecological association between species, and Jaccard had published the union-based form decades earlier. Taha and Hanbury's survey of segmentation metrics is the modern reference for both, and for the relationships between them.

Dice vs F1: the same number under two names

For binary segmentation the Dice coefficient is the F1 score. Both reduce to 2·TP / (2·TP + FP + FN), the harmonic mean of precision and recall. The tool above shows the precision and recall alongside Dice for exactly this reason — you can watch the harmonic mean of those two land on the Dice figure.

This matters when reading across literatures. A machine-learning paper reporting F1 on binary masks and an imaging paper reporting Dice on the same masks have reported the same quantity, and the numbers are directly comparable. Where the two diverge is in multi-class settings, where "F1" usually means an average over classes and the averaging scheme (macro, micro, weighted) changes the answer, while "Dice" is normally reported per structure.

The two ways overlap metrics mislead

Size. Both metrics measure area, so the same absolute error is punished on a small structure and forgiven on a large one. Two units missed and two invented on a 10-unit target gives Dice 0.80; the identical four-unit error against a 1,000-unit target gives 0.998. Nothing about the segmentation changed. This is why a mean Dice pooled across structures of very different sizes is dominated by the large ones, and why a Dice score is only interpretable next to the size of the thing segmented.

Boundaries. Overlap metrics know how much you found, not where you put the edge. Add a one-voxel rind around a large organ and Dice can still read above 0.98 while the contour — the thing a downstream measurement or a surgical margin depends on — is systematically wrong. The standing recommendation is therefore to pair a region metric with a boundary metric: Hausdorff distance, its 95th-percentile variant HD95, or the average symmetric surface distance. Those need the actual surfaces and the voxel spacing, so this tool describes them rather than computing them.

Why Cohen's kappa collapses on pixels

Kappa is the right tool for categorical agreement and the wrong one for masks. Treat a segmentation as a per-pixel "object versus background" decision and the background usually occupies 95% or more of the image, so two annotators agree overwhelmingly by accident. Kappa's chance correction subtracts that accidental agreement away, and because the correction is computed from the marginals, the answer depends on how much empty space you happened to include.

The demonstration in the tool makes this concrete with one synthetic mask pair. On a full 200×200 slice, raw agreement is 99.9% and kappa is about 0.82. Crop to a tight 150-pixel window and the same two annotations give 0.33. Crop to the union itself, with no background at all, and kappa turns negative at about −0.13. Dice stays 0.82 and IoU stays 0.69 across all three, because neither takes the field of view as an input.

That instability is an instance of the prevalence paradox — high agreement with low kappa — described by Feinstein and Cicchetti (1990). It is the same failure mode that shows up on rare categories in text coding, where it has a well-understood fix in Gwet's AC1; our write-up of the kappa paradox covers that case, and the inter-rater reliability calculator computes AC1 beside kappa so you can see the two diverge. For pixels, though, the fix is not a better chance correction — it is to stop counting the background, which is what Dice and IoU already do.

Where this shows up outside imaging

The overlap-versus-category split reappears the moment two people annotate the same transcript. Marking where something occurs is a span-overlap problem, the one-dimensional cousin of IoU: two coders who both flag a passage but disagree on its exact start and end have partial overlap, scored the same way as two masks. Deciding what label the passage gets is a categorical judgement, and that is kappa's home turf.

Both appear in clinical coding. Tagging the exact stretch of disorganised speech against the TLC scale is a boundary-and-overlap question, where character or token overlap plays the role Dice and IoU play for pixels. Rating overall severity against an instrument like the MADRS is categorical, where chance-corrected agreement is the honest measure. Our guides to Dice, IoU and Hausdorff and to image segmentation agreement work through both sides in more detail.

What this tool does not do

It does not compute boundary metrics, because Hausdorff, HD95 and ASSD need the real surfaces and the voxel spacing rather than summary counts. It does not run STAPLE, whose expectation-maximization estimates a consensus and per-annotator sensitivity and specificity from actual masks and cannot be reduced to the three numbers this page takes. And it does not read image files at all — it works from areas you supply, which is what makes it instant and keeps everything on your device.

Two empty masks are scored as perfect agreement here, by the convention that two annotators who both correctly found nothing have not disagreed. That is a choice rather than a mathematical necessity, so it is stated rather than left implicit.

Frequently asked questions

How do you convert Dice to IoU?

Use IoU = Dice / (2 − Dice), and in the other direction Dice = 2·IoU / (1 + IoU). The relationship is a fixed algebraic identity, so no data is needed and nothing is estimated. It is also monotonic, which is the practically important part: whichever mask has the higher IoU also has the higher Dice, so the two metrics never disagree about which segmentation is better. A Dice of 0.90 corresponds to an IoU of about 0.818, and an IoU of 0.5 corresponds to a Dice of about 0.667.

Is the Dice coefficient the same as the F1 score?

Yes, for binary segmentation they are the same number. Both reduce to 2·TP / (2·TP + FP + FN), which is the harmonic mean of precision and recall (Taha & Hanbury, 2015). The two names persist because the metric arrived twice: Dice from ecology and imaging, F1 from information retrieval and classification. If a paper reports Dice and another reports F1 on the same binary masks, those figures are directly comparable.

Why is Dice always higher than IoU?

Because Dice counts the shared region twice in the numerator while IoU counts the union once in the denominator, so for any partial overlap Dice is the larger number. They coincide only at 0 and at 1. The gap is widest in the mid-range, around IoU 0.5, where Dice reads about 0.667. This is why quoting an overlap score without naming which metric produced it is genuinely ambiguous rather than a pedantic complaint.

Why does Cohen's kappa change when you crop the image?

Because kappa's chance correction is computed from the marginals, and the marginals depend on how much background you included. Treat a segmentation as a per-pixel object-versus-background classification and the background usually dominates, so two annotators agree most of the time by accident and kappa subtracts nearly all of that agreement away. One synthetic mask pair scores kappa 0.82 on a full 200×200 slice, 0.33 in a tight 150-pixel window, and −0.13 when cropped to the union alone. Dice stays 0.82 and IoU stays 0.69 throughout, because neither metric counts the background at all. That instability is the prevalence paradox (Feinstein & Cicchetti, 1990), and it is why segmentation uses overlap metrics rather than a chance-corrected category statistic.

Why does the same error score so differently on small and large structures?

Because Dice and IoU measure area, so their sensitivity scales with the size of the target. Miss two units and invent two more on a 10-unit structure and Dice is 0.80; make the identical four-unit error on a 1,000-unit structure and Dice is 0.998. Nothing about the segmentation quality changed. The practical consequence is that a mean Dice across structures of very different sizes is dominated by the large ones, and that a Dice score is only interpretable next to the size of the thing being segmented.

Written by Enrique Gutiérrez, PhD (Computer Science) — founder of Tagaroo and Associate Professor of Computer Science, working on inter-rater reliability, measurement and annotation methodology (ORCID).

Last verified: 30 July 2026. Formulas, thresholds and cited figures on this page were checked against their original sources on that date. Every calculation runs in your browser; nothing you enter is transmitted or stored.

Overlap is the same problem in a transcript

Two coders who both flag a passage but disagree on exactly where it starts and ends have partial overlap — the one-dimensional version of what these two circles show. Tagaroo scores that span overlap as coders work, alongside chance-corrected agreement on the labels themselves.

Try Tagaroo free