# Set union calculator

## World's simplest set tool

With this online application, you can quickly find the union of two or more sets. The input sets can have different cardinalities and their format can be configured in the options. If you enable the option that allows repeated elements, then all sets are treated as multisets (sets that allow element copies) and in the output, you'll also get a multiset. Additionally, you can change the format of the output set and also sort the elements alphabetically or alphanumerically. Created by team Browserling.

announcement
a new project!

Super exciting news! We just launched TECHURLS – simple and fun tech news reader. Check it out!

A link to this tool, including input, options and all chained tools.

Can't convert.

Set union calculator tool
What is a set union calculator?

This browser-based program applies the set union operation on multiple sets. The result of the union of two sets A and B is a set C, which is a collection of all elements of set A and all elements of set B. The set union operation is denoted by the symbol ∪ and it's a binary operation. In mathematical terms, the union of sets A and B is defined as follows: A∪B = {x: x ∈ A or x ∈ B}. For example, the union of two sets A = {1, 2, 3} and B = {4, 5} is the set {1, 2, 3, 4, 5}. The union of three sets A = {1, 2, 3}, B = {4, 5}, and C = {a, b} is the set {1, 2, 3, 4, 5, a, b}. To find the union of several sets, you need to enter all of them in the input field separated by the set separator character. By default, individual sets are separated by the string with three dashes "---", however, you can change the set string separator in the options. All entered sets must use the same style. It can be a classic set style with braces, for example, {a, b, c}, or a rarer set style, for example, [a; b; c]. The style of a set can be adjusted using the set element delimiter option and the side character option (for characters on the sides of a set). By default, the output union set is not a multiset, meaning that if sets A and B contain the same element, then in the output it's displayed only once. For example, for A = {1, 2, 3} and B = {2, 3, 4} the union is {1, 2, 3, 4}. If you enable the "Allow Repeated Elements" option, you will get a union multiset that contains element copies {1, 2, 3, 2, 3, 4}. Also, by default, given input sets A, B, C, D, …, the elements in the union will appear in the order they are in the input sets. An additional feature lets you sort the output set alphabetically or alphanumerically. Setabulous!

Set union calculator examples
Click to use

Union of Two Sets

In this example, we find the union of two sets of integers. Both sets have cardinalities of 3 (meaning each has 3 elements in it) and they are written in Roster notation (also known as enumeration notation) that explicitly lists all members of each set. We separate both sets with three dashes and use the standard set formatting options with curly braces around set elements and commas between set elements. The output set, which is the union of both input sets has a cardinality of 5 because both input sets contain the same number "2". Mathematical sets contain only distinct objects and this is why the number "2" wasn't duplicated. However, there's also something called a multiset that permits repeating objects. If you activate the "Allow Repeated Elements" option, then the integer "2" will be duplicated two times.

{1, 2, 4}
---
{2, 5, 8}

{1, 2, 4, 5, 8}

**Required options**

The delimiter character that
separates the input sets.
(The default is three dashes.)

The delimiter character that
separates input set elements.

Symbol that starts a set.

Symbol that ends a set.

If selected, the output set will
be a multiset that allows
duplicate elements.

The delimiter character that
separates set union elements.

Symbol that starts a set.

Symbol that ends a set.

Preserve the order of elements
as they are in the input sets.

2D and 3D Coordinate Points

In this example, the input sets are coordinate points in two-dimensional and three-dimensional spaces. The coordinates are semicolon-separated and the sets are enclosed in round parentheses. The delimiter character between the sets is the newline character "\n", which means that each set is on a new line. We enter all these characters in the input set style options but for the output set style, we use commas instead of semicolons. We also sort the set union alphanumerically that makes all numeric values go from the smallest to largest and all letters go alphabetically from a to z.

(0; 0)
(-2; -3)
(3; 4; 6)
(z; x; y)
(i; j; k)

(-3, -2, 0, 3, 4, 6, i, j, k, x, y, z)

**Required options**

The delimiter character that
separates the input sets.
(The default is three dashes.)

The delimiter character that
separates input set elements.

Symbol that starts a set.

Symbol that ends a set.

If selected, the output set will
be a multiset that allows
duplicate elements.

The delimiter character that
separates set union elements.

Symbol that starts a set.

Symbol that ends a set.

Rearrange the elements of the
output set in alphanumerical order.

Multiset Union

In this example, we load three multisets of different cardinalities and contents in the input box and separate them with the union symbol ∪. The first multiset consists of numbers, the second multiset consists of Latin letters, and the third multiset consists of ASCII symbols. They are all wrapped in square brackets and use a space to separate the elements. When calculating the union of these three multisets, we activate the option "Allow Repeated Elements". As a result, the output set is also made to be a multiset and all duplicate numbers, letters, and symbols in the input sets are copied to the output set. We also sorted the output set in alphabetical order and customized the output set format by entering angle brackets as the set wrapper symbols.

[0 5 5 20 100 -9] ∪ [s e t t o o l s] ∪ [! ^ _ ^ !]

<! ! -9 0 100 20 5 5 ^ ^ _ e l o o s s t t>

**Required options**

The delimiter character that
separates the input sets.
(The default is three dashes.)

The delimiter character that
separates input set elements.

Symbol that starts a set.

Symbol that ends a set.

If selected, the output set will
be a multiset that allows
duplicate elements.

The delimiter character that
separates set union elements.

Symbol that starts a set.

Symbol that ends a set.

Rearrange the elements of the
output set in alphabetical order.

Pro tips
Master online set tools

You can pass input to this tool via

__?input__query argument and it will automatically compute output. Here's how to type it in your browser's address bar. Click to try!
https://onlinesettools.com/find-set-union

__?input__=%7B1%2C%202%2C%204%7D%0A---%0A%7B2%2C%205%2C%208%7D&input-set-separator=---&input-element-separator=%2C%20&input-open-set=%7B&input-close-set=%7D&allow-repetitions=false&output-element-separator=%2C%20&output-open-set=%7B&output-close-set=%7D&do-not-sort=true
All set tools

Quickly find the powerset P(S) of the given set S.

Quickly reverse the order of elements in an ordered set.

Quickly find the number of elements in a set.

Quickly apply the set union operation on two or more sets.

Quickly apply the set intersection operation on two or more sets.

Quickly apply the set difference operation on two or more sets.

Coming soon
These set tools are on the way

Draw a Venn Diagram

Illustrate two or more sets as a Venn diagram.

Find Set Symmetric Difference

Apply the set difference operation on sets A and B.

Find Set Cartesian Product

Apply the set cartesian product operation on sets A and B.

Find All Subsets of a Set

Quickly find all sets that are subsets of set A.

Find All Set Permutations

Generate all permutations of set elements.

Enumerate a Set

Add numbering to all set elements.

Filter a Set

Print set elements that match a filter.

Find Set Elements

Find elements in a set that match certain criteria.

Apply a Function on a Set

Run a function on all elements in a set.

Convert a Multiset to a Set

Convert a set with repeated elements to a standard set.

Convert a Set to a List

Create a list from the given set.

Convert a List to a Set

Create a set from the given list.

Convert a Set to an Array

Create an array from the given set.

Convert an Array to a Set

Create a set from the given array.

Duplicate Set Elements

Repeat set elements multiple times.

Print Duplicate Elements

Find all duplicate elements in a set.

Remove Duplicate Elements

Delete all duplicate elements from a set (leave unique).

Print Unique Elements

Find all unique elements in a set.

Remove Unique Elements

Delete all unique elements from a set (leave duplicates).

Remove Empty Set Elements

Delete empty elements (zero-length elements) from a set.

Find Set Depth

Calculate how many levels of subsets a set has.

Flatten a Set

Decrease subset nesting.

Truncate a Set

Remove elements from a set and make it smaller.

Truncate Set Elements

Shorten all set elements to the given length.

Expand a Set

Add elements to a set and make it bigger.

Split a Set

Split a set into a certain number of subsets.

Join Sets

Merge multiple sets together to form one large set.

Slice a Set

Extract an index-based subset from a set.

Partition a Set

Find disjoint subsets of the given set whose union is the same set.

Randomize a Set

Randomly change the order of elements in a set.

Select a Random Set Element

Pick a random element from the given set.

Select a Random Subset

Pick a random subset of the given set.

Generate an Empty Set

Create a set with no elements.

Generate a Digit Set

Create a set that contains digits.

Generate a Number Set

Create a set that contains numbers.

Generate an Integer Set

Create a set that contains integers.

Generate a Decimal Set

Create a set that contains decimal fractions.

Generate a Letter Set

Create a set that contains letters.

Generate a Character Set

Create a set that contains characters.

Generate a Word Set

Create a set that contains words.

Generate a String Set

Create a set that contains strings.

Generate a Text Set

Create a set that contains text.

Generate a Sentence Set

Create a set that contains sentences.

Generate a Random Set

Create a set that contains random elements.

Generate a Custom Set

Create a custom set with custom elements and custom size.

Generate an Infinite Set

Create a set with infinitely many elements.

Generate a Finite Set

Create a set with a finite number of elements.

Change Set Notation

Change the open-set, close-set, and element separator symbols.

Change Set Size

Add or remove set elements to make it a certain size/length.

Destroy a Set

Launch a Zalgo attack on a set and destroy it.

Compare Sets

Find all differences between two or more sets.

Symmetrize a Set

Convert a regular set to a symmetric multi-set.

Color a Set

Add colors to set elements.

Visualize a Set

Create an abstract visualization of a set.

Convert a Set to an Image

Create a downloadable picture from a set.

Print Set Analytics

Analyze a set and print its statistics.

Subscribe!
Never miss an update

Cool!

Notifications
We'll let you know when we add this tool

Cool!