Skip to content
Omnikalc

Jaccard similarity calculator: how much do two sets overlap?

Enter the sizes of two sets and of their intersection to get the Jaccard similarity and distance, the Dice coefficient, the overlap coefficient and the union.

Updated on
Your inputs

Value out of range

Value out of range

Value out of range

Results

Jaccard similarity

33.33%

Moderate overlap
Jaccard distance
66.67%
Sørensen–Dice coefficient
50.00%
Overlap coefficient
62.50%
Items in the union
150

When you compare two lists, whether of words, customers or species, you need one number for how alike they are. This Jaccard similarity calculator takes the size of set A, the size of set B and the number of items in both to give the Jaccard similarity, the Jaccard distance, the Sørensen–Dice coefficient, the overlap coefficient and the size of the union.

How the calculation works

  • Union = |A| + |B| − |A ∩ B|, the number of different items in the two sets together.
  • Jaccard similarity = |A ∩ B| ÷ |A ∪ B|. It is 0% for sets with nothing in common and 100% for identical sets. Jaccard distance = 100% − the similarity.
  • Sørensen–Dice coefficient = 2 × |A ∩ B| ÷ (|A| + |B|), which gives more weight to the overlap.
  • Overlap coefficient = |A ∩ B| ÷ the size of the smaller set. It is 100% when one set is fully contained in the other. The shared count is capped at the smaller set.

Example

Set A has 120 items, set B has 80, and 50 items are in both. The union is 120 + 80 − 50 = 150 items. The Jaccard similarity is 50 ÷ 150 = 33.33%, so the Jaccard distance is 66.67%. The Dice coefficient is 2 × 50 ÷ 200 = 50%, and the overlap coefficient is 50 ÷ 80 = 62.5%, because the smaller set has 80 items.

Why it matters

The measure is a basic tool of data science, search engines, ecology and genetics. It is simple, it does not depend on the order of items, and it can be read directly as a share of the combined items that both sets contain.

Good to know

The calculator works with counts of items, not with the items themselves, so it assumes that the sets have no duplicates. The shared count is limited to the size of the smaller set. For weighted data, where items have different importance, a weighted or generalized Jaccard index is needed. A high similarity says that the sets overlap, not that they are about the same thing.

The Venn diagram calculator counts the regions of overlapping sets, and the percentage calculator helps to turn the results into shares.

Frequently asked questions

What is the Jaccard similarity?

The Jaccard index, or similarity, measures how much two sets overlap. It is the number of items in both sets divided by the number of items in at least one of them. It runs from 0 for no shared items to 1 for identical sets, and this calculator shows it as a percentage.

What is the difference between Jaccard and Dice?

Both measure overlap, but Dice counts the shared items twice in the numerator and divides by the sum of the sizes. Dice is always at least as large as Jaccard, and the two are linked by the formula Dice = 2J ÷ (1 + J). The ranking of pairs of sets is the same for both.

When should I use the overlap coefficient?

The overlap coefficient divides by the size of the smaller set, so it equals 100% when one set is a subset of the other. It is useful when sets have very different sizes, for example when you compare a short list of keywords to a long document.

What are typical uses?

Jaccard similarity is used to compare documents by their sets of words, to find near duplicate web pages, to compare the species found at two sites in ecology, to compare the customers of two products and to evaluate the overlap between predicted and true regions in image segmentation.

Was this calculator helpful?

Thanks for your feedback!

Results are estimates provided for information purposes. They do not replace professional advice.