Math calculator

Jaccard Index Calculator

How much two sets share.

How much two sets share

Three shared items out of eight distinct. Jaccard 0.37500000 and Dice 0.54545455 — and 2J/(1+J) reproduces the Dice figure to the last digit, because one is a monotone transform of the other.

|A| = 6, |B| = 5, |A ∩ B| = 3, |A ∪ B| = 8

Jaccard = 0.37500000

Dice-Sørensen is 0.54545455 and the overlap coefficient 0.60000000. Dice recovered from Jaccard as 2J/(1+J) gives 0.54545455 — the same figure to the last digit, because Dice is a monotone transform of Jaccard rather than an independent measure. The Jaccard distance is 0.62500000.

Jaccard

0.37500000

|A ∩ B| ÷ |A ∪ B|

Dice-Sørensen

0.54545455

2|A ∩ B| ÷ (|A| + |B|)

Overlap

0.60000000

÷ the smaller set

Jaccard distance

0.62500000

a true metric, unlike 1 − Dice

What each set contains and what they share
RegionCountItems
In both3d, e, f
Only in A3a, b, c
Only in B2g, h
Union8

Because Dice = 2J/(1+J) is strictly increasing, the two measures RANK every pair of sets identically — a comparison that prefers one pair by Jaccard prefers it by Dice too. They differ only in the value, and Dice is always the larger of the two except at 0 and 1.

Sets, so duplicates and order are ignored 1 − Jaccard is a true metric; 1 − Dice is not All three ignore what is absent from both

What this tool shows

Dice is not an alternative to Jaccard — it is 2J/(1+J), a strictly increasing function of it. So the two RANK every pair of sets identically: whichever pair Jaccard calls closer, Dice calls closer too. They differ only in the value, and only at 0 and 1 do they agree on that. The tool computes Dice directly and recovers it from Jaccard, and the two match to the last digit.

  • The Jaccard index, and the Jaccard distance that is a true metric
  • Dice-Sørensen and the overlap coefficient beside it
  • Dice recovered from Jaccard by 2J/(1+J), as a check rather than a claim
  • The intersection and both differences, listed item by item
  • The case where the overlap coefficient is 1 and the other two are not
  • Set semantics: duplicates collapse and order is irrelevant
Three coefficients The exact transform Items listed Distance is a metric

All three ignore what is absent from both sets.

Updated 13 September 2026 · Works in any browser, no installation

The Jaccard index is the size of the intersection divided by the size of the union — the share of everything either set contains that both contain. It runs from 0 for disjoint sets to 1 for identical ones, and 1 − Jaccard is a true distance metric, which is why it underpins deduplication, clustering and near-duplicate detection.

At a glance

Formula shown
J(A,B) = |A ∩ B| / |A ∪ B|. Dice-Sørensen is 2|A ∩ B| / (|A| + |B|), and since |A| + |B| = |A ∪ B| + |A ∩ B| the two are related exactly by Dice = 2J/(1+J) and J = Dice/(2 − Dice). The overlap (Szymkiewicz-Simpson) coefficient divides by min(|A|,|B|) instead, so a subset scores 1 whatever the size difference.
Scenario support
Near-duplicate and plagiarism detection, recommendation and collaborative filtering, document and keyword overlap, ecological community comparison, A/B audience overlap, and comparing which features or tags two items share.
Educational estimate
Planning support from the values you enter — not professional advice.

Dice is a transform of Jaccard, not a rival to it

They are presented as competing similarity measures and chosen by preference. The relationship between them is exact and settles what the choice actually buys.

Dice = 2J/(1+J), and J = Dice/(2−Dice). Either determines the other with no information lost, which the tool demonstrates by computing Dice both ways and matching to the last digit.

The transform is strictly increasing, so the two measures produce the same ORDER over any collection of set pairs. A ranking, a nearest-neighbour search or a threshold sweep gives the same sequence under either.

They agree on a value only at 0 and 1. Everywhere between, Dice is the larger: 0.37500000 becomes 0.54545455, 0.20000000 becomes 0.33333333.

So the choice is about the number, not the answer. Dice gives more generous-looking scores for partial overlap, which is why it is favoured in image segmentation where a coefficient of 0.9 is the reporting convention.

The one real difference is metricity. 1 − Jaccard satisfies the triangle inequality and 1 − Dice does not, so anything relying on a proper distance — clustering, metric trees, locality-sensitive hashing — needs Jaccard.

The overlap coefficient answers a different question

The third measure is not a transform of the other two, and the tool’s second preset shows where it diverges completely.

Overlap divides by the SMALLER set, so a subset always scores 1. Two items entirely inside a ten-item set give an overlap of exactly 1 against a Jaccard of 0.20000000.

Which is right when containment is the question. “Is this short query entirely covered by that long document?” is an overlap question, and Jaccard would answer it badly because the size difference dominates.

And wrong when symmetry matters. Overlap cannot distinguish a small set inside a large one from two identical sets, which is exactly the confusion Jaccard exists to avoid.

It is also not a metric, and it saturates: once containment is complete, making the larger set larger still changes nothing.

All three ignore what is absent from both

This is the property that makes these measures right for sparse data and wrong for dense binary data, and it is easy to miss because it concerns items that appear nowhere in the input.

Nothing in the formulas counts joint absence. Two documents sharing three words out of eight score 0.375 whether the vocabulary is 100 words or 100,000.

Which is correct for sparse data. Two shoppers who both did not buy a particular obscure item have not thereby demonstrated similarity, and a measure that counted that would rate every pair of shoppers as nearly identical.

And wrong for dense binary data where absence is informative — two patients who both lack the same symptom genuinely share something. Simple matching, which counts joint absence, is the measure for that case.

The practical test: would you be surprised if both sets lacked an item? If yes, the absence carries information and Jaccard is throwing it away. If no, Jaccard is right.

At scale you approximate it rather than compute it

Comparing every pair in a large collection is quadratic, and Jaccard has a well-known way around that which is part of why it is the default for deduplication.

MinHash estimates the Jaccard index from small signatures. The probability that two sets share a minimum hash under a random permutation is exactly their Jaccard index, so k hashes give an unbiased estimate with a standard error of about 1/√k.

That exactness is why MinHash exists for Jaccard and not for Dice — the probability identity holds for the union-based form and not for the sum-based one.

Locality-sensitive hashing then avoids the quadratic comparison entirely, by bucketing signatures so that only plausibly-similar pairs are ever compared.

Both rest on 1 − Jaccard being a metric, which is the practical payoff of the property that looks purely theoretical.

When counts matter, sets are the wrong model

These measures treat membership as binary. A word appearing once and a word appearing fifty times are the same to them, and that is often not what is wanted.

Weighted Jaccard handles multisets: Σmin(aᵢ,bᵢ) ÷ Σmax(aᵢ,bᵢ), which reduces to the ordinary index when every count is 0 or 1.

Or move to a vector measure entirely. Cosine similarity uses the counts directly and ignores document length, which is the standard choice for text.

The two answer different questions on the same data. Jaccard asks which terms are shared; cosine asks whether the profiles point the same way.

This tool computes the unweighted set version, which is the right model when membership is genuinely binary — tags, features, categories, keys.

Reporting a similarity coefficient

Three things, and the first is what makes any of the numbers comparable.

Name the coefficient. 0.375 and 0.545 describe the same pair of sets under Jaccard and Dice, so a bare “similarity 0.5” is ambiguous by a wide margin.

Give both set sizes and the intersection size. Three integers, from which any of the three coefficients can be recomputed.

Say how the sets were built. Tokenisation, case handling, stemming and stopword removal change the sets far more than the choice of coefficient changes the score.

Sources and methodology

References for set similarity coefficients.

Method. The sets are built by trimming and de-duplicating the input, so duplicates collapse and order is irrelevant — which is what makes the identical-in-a-different-order preset return exactly 1. Dice is computed directly from the intersection and the two sizes AND recovered from the Jaccard index by 2J/(1+J), and the suite asserts those two agree across randomly generated set pairs. That agreement is the page’s central claim in executable form: two measures that are presented as alternatives are one measure in two parameterisations. The intersection and both differences are returned as sorted lists rather than counts, so the table shows what is shared rather than only how much. Two empty sets return no result. That engine is verified on every change against 100 assertions. The count and the per-case breakdown are published on the formula verification page.

Related calculators

Where this goes next:

Cosine SimilarityCosine with the angle, both norms and Pearson's r beside it — on [1,0,1,0] against [0,1,0,1] the cosine is exactly 0 and Pearson exactly -1, and centring is the only difference.
Phi CoefficientPhi for a 2x2 table printed against the ceiling its marginals impose: on [10, 40, 0, 50] every case is exposed, a complete association, and phi is 0.3333333, which is exactly max phi.
Cohen's KappaKappa with the two figures that explain it: the maximum the marginals permit, and PABAK. Two built-in tables with identical 85% agreement give kappas of 0.6995 and 0.3219, and a third with 94.4% agreement gives −0.0234.
Shannon EntropyEntropy in bits, nats and bans with per-symbol contributions, efficiency and perplexity — and the demonstration that a sorted sequence and its shuffle give identical values to the last bit.
Union and IntersectionSix set operations on two or three sets at once, with the Venn regions, inclusion-exclusion checked against the real counts, and De Morgan verified on your own sets.
PercentageSolve X% of Y, what percent X is of Y, reverse percentage, increase/decrease, discounts, and tax, tip, or commission.

More in Math, or browse all calculators.

Educational use disclaimer

An educational tool. Jaccard, Dice and the overlap coefficient all ignore items absent from both sets, which is appropriate for sparse data and misleading for dense binary data where shared absence is informative. They also treat membership as binary — where counts matter, a weighted or vector measure is the right model.

How we calculate · Found an error? email us

Authorship & verification

Written and maintained by , a business operator who builds spreadsheet-based calculators.

What's changed (5 updates)

Published 13 September 2026

  1. Published a set-similarity tool reporting Jaccard, Dice-Sørensen and the overlap coefficient together, with the intersection and both differences listed item by item rather than counted.
  2. Made the relationship between the first two exact and executable: Dice = 2J/(1+J), computed directly and recovered from Jaccard, agreeing bit-for-bit on 300 generated set pairs. Because the transform is strictly increasing, the two RANK every pair of sets identically and agree on a value only at 0 and 1.
  3. Which reframes the usual choice: picking Dice over Jaccard changes the number and never the answer — except for metricity, where 1 − Jaccard satisfies the triangle inequality and 1 − Dice does not, and everything built on a proper distance needs the first.
  4. Showed where the overlap coefficient genuinely diverges: two items entirely inside a ten-item set give an overlap of exactly 1 against a Jaccard of 0.20000000, which is right for containment questions and wrong for symmetric ones.
  5. Recorded that all three ignore joint absence, with the practical test for whether that matters: would you be surprised if both sets lacked an item?

Add this calculator to your site

Responsive embed — and private: nothing your visitors type leaves their browser.