Union & Intersection Calculator (Set Operations)

Calculate union, intersection, difference, and symmetric difference of two sets. Venn diagram, Jaccard similarity, power set size, and complement analysis.

A ∪ B (Union)
{1, 2, 3, 4, 5, 6, 7}
|A ∪ B| = 7
A ∩ B (Intersection)
{3, 4, 5}
|A ∩ B| = 3
A − B (Difference)
{1, 2}
Elements in A but not B: 2
B − A (Difference)
{6, 7}
Elements in B but not A: 2
A △ B (Symmetric Diff)
{1, 2, 6, 7}
|A △ B| = 4
Jaccard Similarity
0.4286
|A∩B|/|A∪B| = 3/7
Sørensen-Dice
0.6000
2|A∩B|/(|A|+|B|) = 6/10
Inclusion-Exclusion
5+5−3=7
Should equal |A∪B|=7: ✓

Venn Diagram

A only2A∩B3B only2AB

Similarity Metrics

Jaccard
42.9%
Dice
60.0%
Overlap
60.0%

Set Properties

PropertySet ASet BA ∪ B
Cardinality557
Sum152528
Min131
Max577
Power set size2^5 = 322^5 = 322^7 = 128
Cartesian |A×B|25
Complement (in U){6, 7}{1, 2}

All Operations Summary

OperationResultSize
A{1, 2, 3, 4, 5}5
B{3, 4, 5, 6, 7}5
A ∪ B{1, 2, 3, 4, 5, 6, 7}7
A ∩ B{3, 4, 5}3
A − B{1, 2}2
B − A{6, 7}2
A △ B{1, 2, 6, 7}4
A′ (complement){6, 7}2
B′ (complement){1, 2}2
U (universal){1, 2, 3, 4, 5, 6, 7}7
Planning notes, formulas, and examples

About the Union & Intersection Calculator (Set Operations)

The **Union & Intersection Calculator** performs all fundamental set operations on two sets of numbers and displays the results with a visual Venn diagram. Enter any two sets of comma-separated numbers, and the calculator computes the union (A ∪ B), intersection (A ∩ B), set differences (A − B and B − A), symmetric difference (A △ B), and complements relative to a universal set.

Set theory is the foundation of modern mathematics, computer science, database queries, probability theory, and logic. Union and intersection operations appear everywhere — from SQL JOIN operations and search engine queries to probability calculations (P(A∪B) = P(A) + P(B) − P(A∩B)) and Venn diagram problems in discrete math courses. Understanding these operations is essential for data analysis, programming, and mathematical reasoning.

Beyond basic operations, this calculator computes three important similarity metrics: the Jaccard index (|A∩B|/|A∪B|), the Sørensen-Dice coefficient (2|A∩B|/(|A|+|B|)), and the Overlap coefficient (|A∩B|/min(|A|,|B|)). These metrics are widely used in data science, information retrieval, ecology, and machine learning to measure how similar two sets are. Visual progress bars show these similarities at a glance.

The properties table shows cardinality, sum, min, max, power set size, and Cartesian product size for each set. The inclusion-exclusion principle is verified in real time: |A∪B| = |A| + |B| − |A∩B|. An optional power set enumeration lists all subsets for small sets (up to 6 elements). Six preset examples cover common scenarios from prime numbers to Fibonacci sequences, and the universal set can be calculated automatically or specified manually.

When This Page Helps

Union & Intersection Calculator (Set Operations) helps you avoid repetitive setup mistakes when solving trigonometric and coordinate-geometry problems. Instead of recalculating conversions, signs, and edge cases by hand, you can test inputs immediately, inspect intermediate values, and confirm final answers before submitting work or using numbers in downstream calculations. It surfaces key outputs like A ∪ B (Union), A ∩ B (Intersection), A − B (Difference) in one pass.

How to Use the Inputs

  1. Enter the required inputs (Set A (comma-separated numbers), Set B (comma-separated numbers), Universal Set).
  2. Complete the remaining fields such as Universal Set U, Show Power Set Info.
  3. Review the output cards, especially A ∪ B (Union), A ∩ B (Intersection), A − B (Difference), B − A (Difference).
  4. Compare the result with the formula and worked example so you can catch input, rounding, or setup mistakes.
Formula used
Union A∪B = all elements in either set. Intersection A∩B = elements in both. Difference A−B = elements in A but not B. Symmetric difference A△B = (A−B)∪(B−A). Jaccard = |A∩B|/|A∪B|.

Example Calculation

Result: Union={1,2,3,4,5,6,7}, Intersection={3,4,5}

Using A={1,2,3,4,5}, B={3,4,5,6,7}, the calculator returns Union={1,2,3,4,5,6,7}, Intersection={3,4,5}. This example mirrors the calculator's live computation flow and is useful for checking manual steps and unit handling.

Tips & Best Practices

  • Duplicates in your input are removed automatically (sets contain unique elements).
  • A Jaccard index of 1.0 means the sets are identical; 0.0 means completely disjoint.
  • Power set size grows exponentially: a set of n elements has 2ⁿ subsets.
  • The symmetric difference equals the union minus the intersection: A△B = (A∪B) − (A∩B).
  • For probability: P(A∪B) = P(A) + P(B) − P(A∩B) mirrors the inclusion-exclusion principle.

What This Union & Intersection Calculator (Set Operations) Solves

This calculator is tailored to union & intersection calculator (set operations) workflows, including common input modes, unit handling, and special-case behavior. It is designed for fast checking during homework, exam preparation, technical drafting, and coding tasks where trigonometric consistency matters.

How To Interpret The Outputs

Use the primary result together with supporting outputs to verify direction, magnitude, and validity. Cross-check against known identities or geometric constraints, and confirm that angle ranges, sign conventions, and domain restrictions are satisfied before using the numbers elsewhere.

Study And Practice Strategy

A reliable way to improve is to solve once manually, then verify with the calculator and explain any mismatch. Repeat this on varied examples and edge cases. The built-in preset scenarios for quick trials, comparison tables for side-by-side validation, visual cues that make trends and quadrants easier to read help you build pattern recognition and reduce sign or conversion errors over time.

Sources & Methodology

Last updated:

Frequently Asked Questions

  • The union A∪B is the set of all elements that are in A, in B, or in both. For example, {1,2,3} ∪ {3,4,5} = {1,2,3,4,5}. Duplicates appear only once.