Free Union and Intersection Calculator

Separate elements with commas

Separate elements with commas

Enter elements for each set to see the union and intersection

Understanding Set Union and Intersection

Sets are unordered collections of unique objects, and comparing them often relies on two core operations: union and intersection. This tool acts as both a set union calculator and a set intersection calculator—also referred to as an A∪B calculator or A∩B calculator—making it straightforward to compute these operations for any combination of sets. It also serves as a Venn diagram calculator, giving you an immediate visual picture of how sets relate.

Formal Definitions

Given two sets AA and BB:

  • The union A∪BA \cup B consists of every element that appears in at least one of the sets:
A∪B={x∣x∈A or x∈B}A \cup B = \{ x \mid x \in A \ \text{or} \ x \in B \}
  • The intersection A∩BA \cap B contains only those elements that belong to both sets simultaneously:
A∩B={x∣x∈A and x∈B}A \cap B = \{ x \mid x \in A \ \text{and} \ x \in B \}

In simpler terms, the union gathers all distinct items from the combined collections, while the intersection retains only the common portion. As a direct consequence, the intersection is always a subset of the union, and the union is always a superset of each individual set.

Contrasting Union and Intersection

The key difference lies in inclusivity. The union includes everything—elements from any of the sets are accepted—so it tends to be the larger result. The intersection is selective, admitting only elements found in every set. Therefore:

  • If one set is completely contained within another (e.g., B⊆AB \subseteq A), then A∪B=AA \cup B = A and A∩B=BA \cap B = B.
  • If two sets have no elements in common, the intersection is the empty set (∅\emptyset), while the union simply merges all distinct elements.

Algebraic Properties

Union and intersection behave much like addition and multiplication in arithmetic and share several properties:

  • Commutativity: The order of the sets does not affect the result.
    A∪B=B∪AA \cup B = B \cup A and A∩B=B∩AA \cap B = B \cap A

  • Associativity: When working with three or more sets, parentheses can be rearranged freely.
    A∪(B∪C)=(A∪B)∪CA \cup (B \cup C) = (A \cup B) \cup C
    A∩(B∩C)=(A∩B)∩CA \cap (B \cap C) = (A \cap B) \cap C

  • Distributivity: Each operation distributes over the other, a property unique to set algebra (in arithmetic only multiplication distributes over addition).
    A∪(B∩C)=(A∪B)∩(A∪C)A \cup (B \cap C) = (A \cup B) \cap (A \cup C)
    A∩(B∪C)=(A∩B)∪(A∩C)A \cap (B \cup C) = (A \cap B) \cup (A \cap C)

These rules parallel the logical connectives OR and AND and are fundamental for simplifying set expressions.

Visualizing with Venn Diagrams

A Venn diagram represents each set as a circle within a universal rectangle. The union corresponds to the entire area covered by all circles, while the intersection appears as the overlapping region. The calculator generates a Venn diagram automatically after you input your sets, highlighting which elements are exclusive to each set and which are shared.

Practical Example: Using the Set Operations Calculator

Suppose two friends, Sam and Taylor, list their favorite activities:

  • Sam: painting (P), cycling (C), hiking (H), reading (R)
  • Taylor: cycling (C), reading (R), gaming (G), photography (Ph)

For convenient entry, map each activity to a number: P=1, C=2, H=3, R=4, G=5, Ph=6.
Sam’s set becomes {1,2,3,4}\{1,2,3,4\}; Taylor’s set becomes {2,4,5,6}\{2,4,5,6\}.

Using the calculator:

  1. Choose 2 as the number of sets and individual entries as the input format.
  2. Enter Sam’s numbers (1,2,3,4) in the first section and Taylor’s numbers (2,4,5,6) in the second.
  3. The tool instantly returns:
    • Elements exclusive to Sam: {1,3}\{1,3\} (painting, hiking)
    • Elements exclusive to Taylor: {5,6}\{5,6\} (gaming, photography)
    • Union A∪B={1,2,3,4,5,6}A \cup B = \{1,2,3,4,5,6\} (all six activities)
    • Intersection A∩B={2,4}A \cap B = \{2,4\} (cycling, reading)

A Venn diagram is also displayed, with the shared region labeled {2,4}\{2,4\} and the exclusive portions clearly marked.

Expanding to More Than Two Sets and Intervals

The calculator is not limited to two sets. You can analyze three, four, or more sets simultaneously. In addition to the overall union and intersection, the tool shows the elements that belong exclusively to each individual set.

Beyond discrete elements, the calculator also supports sets expressed as intervals (e.g., [1,5)[1, 5), (2,∞)(2, \infty)). In interval notation mode, it computes the union and intersection as new intervals, correctly handling open and closed endpoints. This makes it useful for solving inequalities and working with continuous ranges.

Whether you are a student learning set theory, a professional analyzing overlapping data, or simply someone needing quick set computations, this set operations calculator provides a reliable, visual solution. It combines a dedicated A∪B calculator, A∩B calculator, and Venn diagram calculator in one accessible platform.

FAQ

1. How can I compute A∪B and A∩B using this calculator?

Select the number of sets (e.g., 2), choose 'individual entries', then input the elements of each set. The calculator instantly outputs the union, intersection, and elements exclusive to each set, along with a Venn diagram.

2. What exactly distinguishes set union from set intersection?

The union contains every element that appears in at least one of the sets, while the intersection only keeps elements present in all sets. As a result, the union is always larger than or equal to the intersection.

3. Is it possible to use the calculator with more than two sets?

Yes, you can choose any number of sets. The tool will compute the overall union, overall intersection, and the exclusive elements for each set.

4. Can I input sets defined as intervals (like [1,5) ) instead of listing each element?

Absolutely. In interval notation mode, the calculator handles continuous intervals and returns the union and intersection as new intervals, properly considering open or closed endpoints.

How to Use

  1. Select the number of sets (2 or 3) you want to work with.
  2. Enter the elements of each set, separated by commas.
  3. View the union, intersection, and elements unique to each set instantly.