Union and Intersection Calculator
Compare two to four finite sets or real-number interval sets, then inspect their union, intersection, sizes, overlap, and membership details.
Set inputs
Choose how many sets participate in both operations.
Separate elements with commas or line breaks.
Example: 1, 2, 3, 4, 5
Example: 2, 3, 6, 7
Required when 3 or 4 sets are selected.
Required when 4 sets are selected.
Live results
Union
A ∪ B = {1, 2, 3, 4, 5, 6, 7}
Union size
7
Intersection size
2
Overlap rate
28.57%
Intersection
A ∩ B = {2, 3}
Membership details
| Element | In A | In B | Membership count |
|---|---|---|---|
| 1 | Yes | No | 1 |
| 2 | Yes | Yes | 2 |
| 3 | Yes | Yes | 2 |
| 4 | Yes | No | 1 |
| 5 | Yes | No | 1 |
| 6 | No | Yes | 1 |
| 7 | No | Yes | 1 |
Membership count shows how many selected sets contain each distinct element. Duplicate entries inside one set are removed before calculation.
How to use this union and intersection calculator
What this calculator does
This calculator combines and compares two, three, or four sets. It returns the Union, which contains every distinct member appearing in at least one selected set, and the Intersection, which contains only members shared by every selected set. It also reports cardinalities, an overlap rate, set-exclusive members in individual-element mode, and a detailed membership table. It evaluates the information you enter; it does not infer a universal set, calculate complements, or decide whether differently spelled labels should mean the same thing. The standard mathematical definitions are summarized in the Wolfram MathWorld overview of sets and set operations.
When to use it
Use the calculator to compare survey responses, product or customer lists, course enrollments, permissions, tags, experimental groups, or any other finite collections. Switch to interval notation when comparing ranges on the real number line, such as acceptable measurement bands, solution intervals, or overlapping time-free numeric domains. It is also useful for checking homework examples and verifying whether several sets are disjoint, identical, nested, or only partly overlapping.
How to calculate
- The calculator opens with a ready-to-use demonstration: Set A is 1, 2, 3, 4, 5 and Set B is 2, 3, 6, 7. Its live results and a validated example Excel workbook are immediately available.
- Choose Number of sets. Set C becomes required for three sets, and Set D becomes required for four.
- Choose Input form. For Individual elements, separate entries with commas or line breaks. For Interval notation, enter intervals such as
[1,5][1,5]; (8,10[2,2] is a valid singleton, while (2,2), [2,2), and (2,2] are empty and therefore rejected as input.