How do you calculate Jaccard similarity?
Divide the number of items in both sets by the number of unique items in either set. For A = {red, blue, green} and B = {blue, green, yellow}, two items overlap and the union has four. The Jaccard similarity is 2 ÷ 4 = 0.5.
Jaccard similarity = intersection size ÷ union size.
Jaccard distance is one minus similarity when the similarity is defined. SciPy's Jaccard distance reference gives the related definition for Boolean vectors.
How are Jaccard, Dice and overlap scores different?
Sørensen–Dice divides twice the shared count by the sum of the two set sizes. The overlap coefficient divides the shared count by the smaller set size. If A has two items and both occur in a four-item B, Jaccard is 0.5, Dice is about 0.666667 and the overlap coefficient is 1. The scores answer different questions about the same intersection.
Dice similarity = 2 × intersection size ÷ (size A + size B). Overlap coefficient = intersection size ÷ min(size A, size B).
How pasted lists become sets
Use a comma or line break between items. Spaces inside a label stay part of the item. Surrounding spaces, empty entries and repeats do not contribute extra items. Canonically equivalent Unicode spellings match. Choose whether uppercase and lowercase differences matter. The calculator compares set membership without weights or item order.
What happens when a set is empty?
When exactly one set is empty, Jaccard and Dice are zero and the overlap coefficient is undefined. When both are empty, all three formulas have zero denominators. This worksheet shows undefined. Some software assigns a default value to an empty comparison. State the convention when comparing scores across tools.
Pasted lists stay in the browser. If you choose to share a result, the link includes only the two set sizes and their shared count. The reopened calculator uses the counts worksheet.