Set Operations Calculator
Enter two sets and get every common operation at once: union, intersection, difference, and symmetric difference, plus subset, superset, and disjoint checks. Elements can be separated by commas, spaces, or new lines, and results update as you type.
How to calculate set operations
- Type the elements of Set A, separated by commas, spaces, or new lines.
- Type the elements of Set B the same way.
- Read each result panel and copy the union, intersection, or difference you need.
Examples
Two number sets
A = 1, 2, 3 and B = 2, 3, 4
Union {1, 2, 3, 4}, Intersection {2, 3}, A minus B {1}Word sets
A = apple, banana and B = banana, cherry
Union {apple, banana, cherry}, Intersection {banana}Frequently asked questions
What is the difference between union and intersection?
The union is every element that appears in either set, with duplicates removed. The intersection is only the elements that appear in both sets at the same time.
What does the difference (A minus B) mean?
The difference A minus B keeps the elements that are in Set A but not in Set B. It is not symmetric, so A minus B and B minus A usually give different results.
What is the symmetric difference?
The symmetric difference is everything that is in exactly one of the two sets. It equals the union with the shared (intersection) elements removed.
How do subset, superset, and disjoint work here?
Set A is a subset of B when every element of A is also in B, and a superset when every element of B is in A. Two sets are disjoint when they share no elements. The empty set is a subset of, and disjoint from, every set.
How are elements ordered and deduplicated?
Repeated elements are collapsed to one, since a set holds each value only once. Results sort numerically when every element is a number, so 10 comes after 2, and sort alphabetically otherwise.
Are my sets private?
Yes. Every calculation runs in your browser. Nothing you type is uploaded to a server or stored.
Related tools
Average Calculator
Find the mean, median, mode, range, sum, count, min and max of a list of numbers. Paste values separated by commas, spaces or new lines.
GCD and LCM Calculator
Find the greatest common divisor and least common multiple of a list of integers. Enter two or more numbers separated by commas or spaces.
JSON Formatter
Format, validate and minify JSON online. Pretty-print with custom indentation, sort keys and catch syntax errors. Runs in your browser.
Area Calculator
Find the area of a circle, square, rectangle, triangle, trapezoid, parallelogram, ellipse, sector or rhombus. Free and runs in your browser.
Arithmetic Sequence Calculator
Find the nth term, the sum of n terms and the full term list for any arithmetic or geometric sequence. Enter the first term, step or ratio, and n.
Big Number Calculator
Add, subtract, multiply, divide, power, modulo, factorial, GCD and LCM on integers of any length. Exact results with no rounding, computed in your browser.