Calculate a similarity index (Dice/Sørensen or Jaccard) from two set sizes and the items they share, or compare two lists of items directly.

Optional settings


Related Calculators

Similarity Index Formula

The following formula gives Dice (Sørensen) similarity between two sets. Jaccard similarity is C/(A+B−C); select the desired metric or inverse in the calculator.

SI = (2 × C) / (A + B)

Variables:

  • SI is the similarity index
  • C is the number of common items in both sets
  • A is the total number of items in set A
  • B is the total number of items in set B

To calculate the similarity index, multiply the number of common items by 2 and then divide by the sum of the total number of items in both sets.

What is a Similarity Index?

The similarity index is a metric used to quantify the similarity between two sets. It is often used in various fields such as biology to measure species similarity, in information retrieval to compare documents, or in data analysis to compare sets of data. For nonempty sets, the index ranges from 0 to 1, where 0 indicates no common items and 1 indicates identical sets. A zero denominator is undefined. List mode supports unique sets or occurrence-counted multisets; no universal quality bands are assigned.

How to Calculate Similarity Index?

The following steps outline how to calculate the Similarity Index.


  1. First, determine the number of common items (C) shared by both sets.
  2. Next, determine the total number of items in set A (A).
  3. Next, determine the total number of items in set B (B).
  4. Next, gather the formula from above: SI = (2 * C) / (A + B).
  5. Finally, select Dice similarity and Calculate to obtain the Similarity Index (SI). Other solve modes display only their required inputs.
  6. After inserting the variables and calculating the result, check your answer with the calculator above.

Example Problem : 

Use the following variables as an example problem to test your knowledge.

Number of common items (C) = 15

Total number of items in set A (A) = 30

Total number of items in set B (B) = 25