Skip to content

Set Calculator

Enter two sets as comma-separated values. The calculator returns the union, intersection, values only in A, values only in B, the symmetric difference, and the Jaccard overlap index. Duplicates are removed and numeric values are normalized before comparing.

Updated 2026-11-18 Editorial estimate Calccc Editorial Team Free · No sign-up

Separate values with commas, semicolons, or spaces.

Scenarios A/BSave two input sets and compare the results. Stored only in this browser.
AEmpty
BEmpty

Your inputs stay in this browser. No account, no uploads.

Professional worksheet

Detailed schedule & assumptions

Inputs used, method, sensitivity, and any year-by-year table. The summary above stays compact; the audit lives here.

Professional worksheet

Inputs, scope, and sensitivity

Inputs used

Method and scope

Result audit

MetricValue

What this calculator does

A set is a collection where order does not matter and each element appears once. Two sets can be combined in several ways: the union contains everything in either set, the intersection contains only what they share, and the difference contains what is in one but not the other. The symmetric difference contains everything that is in exactly one set. This calculator parses both inputs, removes duplicates, normalizes numbers such as 1 and 1.0, and computes all of those results plus the Jaccard index, which measures how much the sets overlap. It is useful for comparing lists, finding shared tags, or checking survey responses.

How to use it

  1. Enter the first set as values separated by commas, semicolons, or spaces.
  2. Enter the second set the same way.
  3. Read the union, intersection, and difference counts.
  4. Check the breakdown for the actual elements in each result.
  5. Use the Jaccard index to compare overlap between 0% and 100%.

How it works

A ∪ B = every element in A or B. A ∩ B = elements in both. A − B = elements in A but not B. B − A = elements in B but not A. A △ B = (A − B) ∪ (B − A). Jaccard index = |A ∩ B| ÷ |A ∪ B|. In the default case, A = {1,2,3,4} and B = {3,4,5} give a union of 5 elements, an intersection of 2, and a Jaccard index of 40%.

Example calculations

Example 1: A = 1,2,3,4 and B = 3,4,5

The union is {1, 2, 3, 4, 5} with 5 elements. The intersection is {3, 4}, and the symmetric difference is {1, 2, 5}. The Jaccard index is 40.0%.

Example 2: Two lists of words

A = {apple, banana, cherry} and B = {banana, date, apple}. The union has 4 elements, the intersection has 2, and the Jaccard index is 50.0%. The overlap is the two shared words, not the total number of words.

Example 3: Even numbers and small numbers

A = {2,4,6,8} and B = {1,2,3,4}. The union has 6 elements, the intersection is {2, 4}, and the Jaccard index is 33.3%. The Jaccard index is lower than the intersection count suggests because the union is larger.

What the result means

Set operations ignore order and duplicates, so {1, 2, 2, 3} is the same set as {3, 2, 1}. This calculator normalizes numeric values, which means 1 and 1.0 compare as equal; text values are case-sensitive. The Jaccard index is a useful summary of overlap, but it treats every element as equally important. For weighted data, such as product purchases or survey weights, use a weighted overlap measure instead. The results are deterministic and do not depend on the order of the input.

Common mistakes

  • Expecting duplicates to count more than once; a set keeps one copy of each value.
  • Assuming the order of the output matches the order of the input.
  • Mixing numeric and text values that look alike, such as 1 and the word one.
  • Using the intersection count alone when the union size differs between comparisons.
  • Forgetting that text comparison is case-sensitive.

Assumptions and limits

  • Values are separated by commas, semicolons, or whitespace.
  • Duplicates are removed within each set.
  • Numeric values are normalized to a canonical numeric form.
  • Text values are compared exactly, including case.
  • The Jaccard index treats all elements as equally weighted.

Frequently asked questions

What is the difference between union and intersection?

The union contains every element from both sets. The intersection contains only the elements that appear in both. The union is always at least as large as either set; the intersection is never larger than the smaller set.

What is the symmetric difference?

The symmetric difference contains elements that are in exactly one of the two sets. It is the union minus the intersection, or (A − B) ∪ (B − A). It is useful for finding what the sets do not share.

How is the Jaccard index calculated?

Jaccard index = |A ∩ B| ÷ |A ∪ B|. It ranges from 0% when the sets share nothing to 100% when they are identical. It is a common similarity measure in data analysis.

Does order matter in a set?

No. A set is unordered, so {1,2,3} and {3,2,1} are the same. The calculator displays the elements in the order they first appear, but that is a presentation choice, not a set property.

How are numbers like 1 and 1.0 handled?

They are normalized to the same numeric value, so they count as one element. Text values are not numerically normalized, so '01' and '1' remain different if they are entered as text.

Can I compare more than two sets?

This calculator compares two sets. For three or more, compute the union or intersection pairwise, or use a dedicated set tool. The same definitions extend, but the display would need more rows.

Sources

This calculator is an educational set-operations tool. It assumes the values you enter are the complete sets and that exact matching is appropriate. It does not perform fuzzy matching, weighting, or statistical inference.

2026 update

How to use the professional output

This page is not just a formula box. The result is designed to be checked, compared, and taken away.

  • Professional worksheet. The result includes the inputs used, the method and scope, and a one-variable sensitivity check for finance calculators.
  • A/B scenarios. Save two input sets in the browser and compare the primary, secondary, and breakdown figures side by side.
  • Print / PDF and CSV. Print a branded worksheet, or export the year-by-year table when the calculator produces one.

The formulas and assumptions above still govern the number. The worksheet makes the estimate auditable; it does not make it a lender quote, tax return, or personalized advice.

Calccc Editorial Team · Updated 2026-11-18

Prepared by Calccc Editorial Team as an educational estimate. This page is not a licensed professional review and is not financial, medical, legal, or tax advice.

Editorial estimate prepared by the Calccc Editorial Team; not a licensed professional review.