Set Operations Calculator

Union, intersection, difference and symmetric difference of two sets.

Ad placeholder (leaderboard)
Enjoying the tools? Go Pro for £4.99 (one-time) and remove all ads — forever, on this device. Remove ads — £4.99

Set operations calculator

Compute the core operations of set theory on two sets: union (A ∪ B), intersection (A ∩ B), difference (A − B and B − A), and symmetric difference (A △ B). It is for maths students, data wranglers and anyone comparing two lists of values.

How it works

Each input is split on commas and new lines, trimmed, and deduplicated — a set holds each member at most once. The chosen operation then runs:

OperationResult
Union (A ∪ B)every element in A or B
Intersection (A ∩ B)elements in both A and B
Difference (A − B)elements in A but not B
Difference (B − A)elements in B but not A
Symmetric difference (A △ B)elements in exactly one set

The symmetric difference equals (A − B) ∪ (B − A). The result and its cardinality (the number of members) are shown.

Example

With A = 5 and B = 7:

OperationResultSize
Union77
Intersection52
A − B33
Symmetric difference75

Pick an operation and the result updates instantly — all in your browser, with no network calls.

Ad placeholder (rectangle)