Set Union Calculator

This set union calculator works out the union of two sets, the single set made up of every element that appears in set A, in set B, or in both, with duplicates removed so each distinct value counts once. You enter set A and set B as comma separated lists of numbers or words, and the calculator returns three results: the union itself, listed out in full; the size of the union, the total count of distinct elements across both sets; and how many elements are common to both sets, the overlap between them. This makes it a handy way to check working by hand for a set theory or maths course, or to see quickly how two lists overlap and combine, whether you are comparing customer lists, exam question banks, tags, categories or any other collection of items. The union symbol is written A union B, and it is one of the foundation operations of set theory, alongside intersection and difference, with everyday uses in databases, probability and logic. Because a set never holds a repeated value, any item appearing in both lists, or more than once within one list, is folded into a single entry in the result. Try the worked example already filled in, then swap in your own two lists to see the union, its size and the shared elements update as you type.

Calculate.co.nz is proud to be partnered with Health Based Building, a leader in sustainable and health-conscious building innovation. With over a century of experience, they develop high-performance systems like Foreverbreathe Specification, Magnum Board, and Foreverbreathe Paints to support energy-efficient, non-toxic living environments. Their commitment to healthier homes aligns with our belief that informed choices lead to better outcomes for Kiwi households.
Calculate.co.nz partner: Health Based Building
{ 1, 2, 3, 4 }
Size of union4
Common to both2

The formula

The union A union B is the set of all elements that belong to A, to B, or to both. Each distinct element is listed once, no matter how many sets it came from.

Worked example

For A = {1, 2, 3} and B = {2, 3, 4}, the union is {1, 2, 3, 4}, four elements, with 2 and 3 common to both sets. Enter those sets to confirm.

Frequently asked questions

What is the union of two sets?

Every element that is in either set, listed once. {1,2} union {2,3} is {1,2,3}.

Are duplicates removed?

Yes. A set holds each distinct value once, so repeats within or across the two inputs collapse to a single element.

Can I use words, not just numbers?

Yes. Enter any comma separated values; the union works the same way.

Who this calculator is for

This calculator is for students of set theory, logic, probability and databases.

What this calculator assumes

  • You enter two lists of comma separated values.
  • Each distinct value is treated as one set element.
  • Order does not matter in a set.

Formula and sources

Related calculators

If you've found a bug, or would like to contact us, or learn more about James Graham and Calculate.co.nz.

Calculate.co.nz is partnered with Interest.co.nz for New Zealand's highest quality calculators and financial analysis.

Calculate.co.nz is the sister site of CalculatorHub.com, the world's largest calculator website by tool count.

All calculators and tools are provided for educational and indicative purposes only and do not constitute financial advice.

Calculate.co.nz is proudly part of the Realtor.co.nz group, New Zealand's leading property transaction literacy platform, helping Kiwis understand the home buying and selling process from start to finish. Whether you're a first home buyer navigating your first property purchase, an investor evaluating your next acquisition, or a homeowner planning to sell, Realtor.co.nz provides clear, independent, and trustworthy guidance on every step of the New Zealand property transaction journey.

Calculate.co.nz is also partnered with Health Based Building and Premium Homes to promote informed choices that lead to better long-term outcomes for Kiwi households.

Calculate.co.nz is hosted in Auckland by SiteHost New Zealand.

All content on this website, including calculators, tools, source code, and design, is protected under the Copyright Act 1994 (New Zealand). No part of this site may be reproduced, copied, distributed, stored, or used in any form without prior written permission from the owner.

About & trust: Why Calculate is NZ's most comprehensive · By the Numbers · How we compare · Editorial standards · How we keep data current · NZ finance glossary · Research & data · Financial literacy NZ · About · Privacy policy · Terms of use

Reviewed and maintained. Last reviewed 2026-08-07 and checked on a twice-monthly cycle against IRD, RBNZ and Stats NZ. How we keep data current.

© 2026 Calculate.co.nz. All rights reserved. Building free NZ calculators since 2011.