Set Union Calculator
This set union calculator works out the union of two sets, the single set made up of every element that appears in set A, in set B, or in both, with duplicates removed so each distinct value counts once. You enter set A and set B as comma separated lists of numbers or words, and the calculator returns three results: the union itself, listed out in full; the size of the union, the total count of distinct elements across both sets; and how many elements are common to both sets, the overlap between them. This makes it a handy way to check working by hand for a set theory or maths course, or to see quickly how two lists overlap and combine, whether you are comparing customer lists, exam question banks, tags, categories or any other collection of items. The union symbol is written A union B, and it is one of the foundation operations of set theory, alongside intersection and difference, with everyday uses in databases, probability and logic. Because a set never holds a repeated value, any item appearing in both lists, or more than once within one list, is folded into a single entry in the result. Try the worked example already filled in, then swap in your own two lists to see the union, its size and the shared elements update as you type.
The formula
The union A union B is the set of all elements that belong to A, to B, or to both. Each distinct element is listed once, no matter how many sets it came from.
Worked example
For A = {1, 2, 3} and B = {2, 3, 4}, the union is {1, 2, 3, 4}, four elements, with 2 and 3 common to both sets. Enter those sets to confirm.
Frequently asked questions
What is the union of two sets?
Every element that is in either set, listed once. {1,2} union {2,3} is {1,2,3}.
Are duplicates removed?
Yes. A set holds each distinct value once, so repeats within or across the two inputs collapse to a single element.
Can I use words, not just numbers?
Yes. Enter any comma separated values; the union works the same way.
Who this calculator is for
This calculator is for students of set theory, logic, probability and databases.
What this calculator assumes
- You enter two lists of comma separated values.
- Each distinct value is treated as one set element.
- Order does not matter in a set.
Formula and sources
Related calculators
- Set Intersection Calculator: elements common to both sets.
- Prime Factorization Calculator: prime factors of a number.
- Permutation Calculator: count ordered arrangements.