Set Operations Calculator

Enter two sets and choose an operation to see the result and a Venn diagram.

Numbers or words separated by commas. Repeats are counted once.

Numbers or words separated by commas. Repeats are counted once.

Only needed for a complement: everything under consideration.

Operation

A complement uses set A and the universal set.

Try

Result

You enteredA={1, 2, 3, 4}, B={3, 4, 5}A = \{1,\ 2,\ 3,\ 4\},\ B = \{3,\ 4,\ 5\}

A∖B={1, 2}\displaystyle A \setminus B = \{1,\ 2\}

Number of elements

2\displaystyle 2
Show the work
  1. Difference

    The difference A∖BA \setminus B holds the elements of AA that are not in BB.

    A∖B={1, 2, 3, 4}∖{3, 4, 5}={1, 2}A \setminus B = \{1,\ 2,\ 3,\ 4\} \setminus \{3,\ 4,\ 5\} = \{1,\ 2\}
  2. Result

    So A∖B={1, 2}A \setminus B = \{1,\ 2\}, a set of 2 elements.

Worked examples