See below for a detailed description of each operation.
Union
The union of sets (the classic job of a union calculator) contains every element that appears in either set.
Think of it as combining both lists and removing duplicates. In set notation: A ∪ B.
For example, suppose Mary and Carlos are buying fruits and vegetables at a farmstand. Mary's basket contains:
- berries,
- lettuce, and
- apples
and Carlos's basket contains:
- lettuce,
- peppers,
- onions, and
- berries
When they get home, together they purchased:
- apples,
- berries,
- lettuce,
- peppers, and
- onions
This is the union of the two sets!
Try it!
Intersection
The intersection of sets contains only elements that appear in both sets —
the shared overlap in a Venn diagram. In set notation: A ∩ B.
For example, suppose you are a teacher determining which students play multiple sports. The tennis team roster contains:
- Jason,
- James,
- Emily, and
- Robert
while the swim team roster includes:
- Emily,
- Jared,
- Larry, and
- Rachel
The only student on both teams is:
This is the intersection of the two sets!
Try it!
Difference
The difference of two sets contains elements in the first set that do not appear in the second.
Unlike union and intersection, order matters — the second set is subtracted from the first.
For example, suppose a teacher wants students in math courses except those taking geometry. The math roster is:
- Stacy,
- Matthew,
- Jon,
- Caroline
and the geometry roster is:
The remaining students are:
This is the difference of the two sets!
Try it!
Set calculator FAQ
How do I find the union of two sets?
Enter each set in the boxes above, select Union, and read the output.
The union gathers every unique item from either list — a free online union of sets calculator
without signup. Example: {1, 2, 3} ∪ {3, 4} = {1, 2, 3, 4}.
How do I find the intersection of two sets?
Select Intersection instead. The result keeps only items present in both sets —
the same idea as an intersection of sets calculator.
Example: {1, 2, 3} ∩ {3, 4} = {3}.
What is the difference between union and intersection?
Union answers “in A or B (or both)?” Intersection answers “in A and B?”
This union and intersection calculator also supports set difference:
items in the first set that are not in the second (order matters).
Does this work for number-line intervals?
No. This tool works on finite lists of elements (text or numbers as discrete items),
not continuous intervals like [0, 1] ∪ (2, 5].
Use list-style inputs for homework sets, tags, IDs, or names.
Is my data uploaded?
No. The set calculator runs entirely in your browser with JavaScript.
Lists stay on your device unless you copy them yourself.