Files never leave your device

Set operations calculator

Find unions, intersections, differences and subset relations from two lists. Your inputs stay on your device.

Set up your task

Ready. Processing stays in this browser.

How to use Set operations calculator

Find unions, intersections, differences and subset relations from two lists. The pre-filled problem gives you a worked starting point. Compare the response with your own working before trying the self-check below.

  1. Check the example inputs: Set A, Set B.
  2. Change the inputs for your problem. Results update as you type, so finish entering the values before copying an answer.
  3. Use the working to check an intermediate value or assumption. Then change the example as suggested in the self-check and compare the result.

Supported inputs and limits

Separate values with commas or spaces. Labels are case-sensitive. Repeated members count once. A blank list is the empty set.

How it works

Sets represent membership without multiplicity or order. Union takes members from either set, intersection keeps only shared members, and a directed difference keeps members of the first set that are absent from the second. Symmetric difference keeps members that appear in exactly one of the two sets.

These operations appear throughout databases and programming. If two queries return lists of identifiers, an intersection identifies records that meet both conditions. A difference can reveal eligible records missed by a second filter. Real identifiers often differ by case or by their spelling, and this tool compares complete labels.

Example

Run the pre-filled example. Its first result is β€œUnion: {1, 2, 3, 4}”.

Set A
1 2 3
Set B
2 3 4
Union: {1, 2, 3, 4}
Intersection: {2, 3}
A minus B: {1}
B minus A: {4}
Symmetric difference: {1, 4}
A βŠ† B: no Β· B βŠ† A: no

Questions about Set operations calculator

Can I compare identifiers with leading zeros?

Yes. The labels 01 and 1 are kept distinct because the calculation compares text rather than their numeric values.

Can a set contain the same label twice?

A repeated label adds no new member. Use a frequency table when repetition is the data you want to measure.

Change B to contain only the label 2.

B is a subset of A. A minus B still contains 1 and 3, while B minus A is empty.

Related tools

Year 1: Foundations

Last updated