Set Calculator

Compare sets entered as lines or brace lists, with region counts and a Venn diagram.

On-device No sign-up Free to use

Calculate set operation controls

Showing an example. Edit to see your own.

?

One item per line, or commas inside braces such as {red, green, blue}. Blank lines are ignored and repeated items are counted once.

Processed in your browser. Your inputs stay on this device.

Result

Showing an example.

Combine two small sets with a repeated input.

A
B
C
The union contains three unique items; B occurs in both input sets and appears once.

https://usefreetools.net/set-calculator · 20 November 2026

Was this helpful?

How to use Set Calculator

  1. Enter one item per line for A and B, or use a brace list such as {red, green, blue}. An unbraced comma stays inside one item; use lines for items that contain commas.
  2. Choose Case sensitive or Case insensitive. Items are trimmed and repeated compared items count once.
  3. Select union, intersection, a directed difference, symmetric difference or Cartesian product. A minus B differs from B minus A; Cartesian pairs keep A’s item first.
  4. Review the result and region counts. Non-Cartesian modes offer set-venn.svg; Cartesian mode shows two-column pairs and JSON pair lines you can copy.

Example: Set Calculator

Combine two small sets with a repeated input.

You add
Set A: {A, B, B} Set B: {B, C} Operation: Union Comparison: Case sensitive
You get
A B C The union contains three unique items; B occurs in both input sets and appears once.

Supported inputs and limits

  • Up to 500 unique items per set and 100,000 combined input characters.
  • Items are trimmed literal strings; blank lines are ignored and numeric strings are not converted to numbers.
  • Case-insensitive matching uses lowercase comparison, without a locale-equivalence guarantee.
  • Results retain encounter order and a matching item’s first spelling.
  • Cartesian output is capped at 10,000 pairs and an estimated 1,000,000 characters; separate columns and JSON pair text keep punctuation unambiguous.
More details

The Venn diagram is available for other operations and reports input-set region counts, with circle areas that do not scale to those counts.

Where your input is processed

This tool does not upload your inputs. See the limits for anything saved on your device.

Questions about Set Calculator

Is 001 treated as the number 1?

No. Set items are strings. 001 and 1 remain different unless you change the source yourself.

Are duplicate lines counted more than once?

No. A set contains each compared item once. The retained spelling and order follow the selected case policy and encounter order.

What is the difference between A minus B and symmetric difference?

A minus B keeps items only in A. Symmetric difference keeps items found in exactly one of the two sets.

Page updated · Project managed by Tony Hines · Report a problem with Set Calculator