Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools


Cardinality of Sets






Measuring the Size of Sets


Cardinality measures the size of a set — how many elements it contains. For finite sets, cardinality is simply a count. For infinite sets, the situation becomes more subtle: different infinite sets can have different sizes, and comparing them requires the concept of one-to-one correspondence. This leads to the distinction between countable and uncountable infinities.

Key Terms

Cardinality— the number of elements in a set
Finite Set— a set with a bounded element count
Infinite Set— a set that cannot be matched with any finite count
Countable Set— a set whose elements can be listed in a sequence
Uncountable Set— a set too large to be listed sequentially
Equivalent Sets— sets related by having the same cardinality
Power Set— always produces a set of strictly larger cardinality

See All Set Theory Definitions →


Definition of Cardinality


The cardinality of a set AA, denoted ∣A∣|A|, measures the number of elements in AA. This bar notation is one of several cardinality symbols in standard use.

For finite sets, cardinality is determined by counting. If A={a,b,c}A = \{a, b, c\}, then ∣A∣=3|A| = 3. If B={1,2,3,4,5}B = \{1, 2, 3, 4, 5\}, then ∣B∣=5|B| = 5.

The empty set contains no elements:

Definition of Cardinality
∣∅∣=0|\emptyset| = 0

Two sets have the same cardinality when a bijection (one-to-one correspondence) exists between them. For finite sets, this simply means they have the same count. For infinite sets, this definition becomes the primary tool for comparing sizes.

Finite Sets


    A set is finite if its elements can be counted with a natural number. Formally, a set AA is finite if there exists some n∈Nn \in \mathbb{N} such that:

    Finite Sets
    ∣A∣=n|A| = n

    This means a bijection exists between AA and the set {1,2,3,…,n}\{1, 2, 3, \ldots, n\}.

    Examples of finite sets:

  • The set of letters in the English alphabet has cardinality 2626

  • The set of prime numbers less than 2020 is {2,3,5,7,11,13,17,19}\{2, 3, 5, 7, 11, 13, 17, 19\} with cardinality 88

  • Any subset of a finite set is finite

  • The cardinality of a finite union of finite sets satisfies the inclusion-exclusion principle:

    Inclusion-Exclusion - Two Sets
    ∣A∪B∣=∣A∣+∣B∣−∣A∩B∣|A \cup B| = |A| + |B| - |A \cap B|
    Learn more about this formula: Inclusion-Exclusion - Two Sets →


    The correction term ∣A∩B∣|A \cap B| accounts for elements counted twice when the sets overlap. The pattern extends to three sets by alternating between adding singles, subtracting pairwise intersections, and adding back the triple intersection:

    Inclusion-Exclusion - Three Sets
    ∣A∪B∪C∣=∣A∣+∣B∣+∣C∣−∣A∩B∣−∣A∩C∣−∣B∩C∣+∣A∩B∩C∣|A \cup B \cup C| = |A| + |B| + |C| - |A \cap B| - |A \cap C| - |B \cap C| + |A \cap B \cap C|
    Learn more about this formula: Inclusion-Exclusion - Three Sets →


    When the sets share no elements, the correction terms vanish and the cardinality simply adds:

    Cardinality of Disjoint Union
    ∣A∪B∣=∣A∣+∣B∣when A∩B=∅|A \cup B| = |A| + |B| \quad \text{when } A \cap B = \emptyset
    Learn more about this formula: Cardinality of Disjoint Union →

UABUAB
Why the correction term exists

Two frozen configurations tell the whole story: when the circles overlap (top), the lens lies inside both sets — summing |A| + |B| counts it twice, so |A ∩ B| is subtracted once. When the sets are disjoint (bottom), there is no lens and the counts simply add. Slide between the two situations yourself on the two-set Venn explorer.

Counting without double-counting is the entire craft of finite cardinality — inclusion-exclusion just states it as a formula, and it scales to any number of sets.

Infinite Sets


    A set is infinite if it is not finite — no natural number can express its size.

    The standard number sets are all infinite:

  • N={0,1,2,3,…}\mathbb{N} = \{0, 1, 2, 3, \ldots\} — the natural numbers

  • Z={…,−2,−1,0,1,2,…}\mathbb{Z} = \{\ldots, -2, -1, 0, 1, 2, \ldots\} — the integers

  • Q\mathbb{Q} — the rational numbers

  • R\mathbb{R} — the real numbers

  • A defining property of infinite sets: an infinite set can be put into one-to-one correspondence with a proper subset of itself. For example, the function f(n)=2nf(n) = 2n maps N\mathbb{N} bijectively onto the even numbers, which form a proper subset of N\mathbb{N}.

    Not all infinite sets have the same cardinality. The integers and rationals turn out to be the same size as the natural numbers, but the real numbers form a strictly larger infinity.
An infinite set pairs with a proper part of itself; a finite set cannotℕeven numbers ⊂ ℕ0123…0246…n ↦ 2n: every n has a partner{0, 1, 2, 3}{0, 2}012no partner3no partner02n ↦ 2n: 2 and 3 have no partner
The rule n ↦ 2n, on an infinite set and on a finite one

On the left every natural number n is sent to 2n, and every even number is hit exactly once — so ℕ pairs perfectly with the even numbers, a part of itself. On the right the same rule is tried on {0, 1, 2, 3} and its part {0, 2}: 2 and 3 are left with nowhere to go. A finite set can never pair with a proper part of itself; an infinite set always can.

Being able to pair with a proper part of itself is exactly what separates an infinite set from a finite one.

Countable Sets


A set is countably infinite if its elements can be put in one-to-one correspondence with the natural numbers N\mathbb{N}. Such a set can be listed as a sequence:

Countable Sets
a1,a2,a3,…a_1, a_2, a_3, \ldots

where every element appears exactly once.

The integers Z\mathbb{Z} are countable. The listing:

Countable Sets
0,1,−1,2,−2,3,−3,…0, 1, -1, 2, -2, 3, -3, \ldots

establishes a bijection with N\mathbb{N}.

The rationals Q\mathbb{Q} are countable despite appearing denser than Z\mathbb{Z}. By arranging positive rationals in a grid and traversing diagonally, every rational is eventually listed.

A set is called countable if it is either finite or countably infinite. Some authors reserve "countable" for countably infinite sets only — context determines the convention.

THEOREM
The union of countably many countable sets remains countable.

This is why Q\mathbb{Q} is countable: it is a countable union of countable sets (rationals with each fixed denominator).
Walking the grid of fractions diagonal by diagonal lists every positive rational oncenumerator →denominator →1122334455111/231/341/491/510222/22/382/42/5353/273/33/43/5464/24/34/44/55115/25/35/45/5…⋮…⋮…⋮…⋮…⋮dashed: already listed (2/2 = 1), skippedℚ⁺ in order: 1, 2, 1/2, 1/3, 3, 4, 3/2, 2/3, 1/4, 1/5, 5, …
Listing the positive rationals

Each fraction p/q sits at column p, row q. The walk runs diagonal by diagonal, turning at the edges, so any fraction is reached after finitely many steps. A fraction not in lowest terms, such as 2/2, names a number already listed — it is dashed and gets no number, so every rational appears exactly once. The order numbers are the bijection with the natural numbers.

A set is countable precisely when some walk like this reaches every one of its elements.

Uncountable Sets


A set is uncountable if it is infinite but not countable — its elements cannot be listed in a sequence that covers them all.

THEOREM
The real numbers R\mathbb{R} are uncountable.

Cantor's diagonal argument proves this: assume a listing of all real numbers between 00 and 11 exists. Construct a new number by making its nn-th decimal digit different from the nn-th digit of the nn-th number in the list. This new number differs from every listed number, contradicting the assumption that the list was complete.

Any interval (a,b)(a, b) with a<ba < b is uncountable. In fact, every such interval has the same cardinality as R\mathbb{R} itself — a bijection exists between them.

The cardinality of R\mathbb{R} is denoted c\mathfrak{c} (for continuum) or 2ℵ02^{\aleph_0}, where ℵ0\aleph_0 — aleph-null, the Hebrew letter aleph carrying subscript zero — is the size of N\mathbb{N} and the smallest infinite cardinal. The second spelling indicates that it equals the cardinality of the power set of N\mathbb{N}.
Changing every diagonal digit builds a number missing from any listan assumed complete list of numbers between 0 and 1r₁ = 0.31415…differs from x in digit 1r₂ = 0.27182…differs from x in digit 2r₃ = 0.50000…differs from x in digit 3r₄ = 0.14142…differs from x in digit 4r₅ = 0.66666…differs from x in digit 5x = 0.43→487→810→154→576→7…x is on no row — the list was not complete
Cantor's diagonal, five rows deep

Suppose the rows r₁, r₂, … list every number between 0 and 1. Take the n-th digit of the n-th row (boxed) and change it; those changed digits spell a new number x. x cannot be r₁ — they differ in the first digit; it cannot be r₂ — they differ in the second; and so on down every row. So no list is complete, and the reals are uncountable.

Whatever list is proposed, the diagonal construction produces a real number it leaves out.
Category Defining condition Example sets Standard proof technique
Countably infinite a bijection with ℕ exists ℕ, ℤ, ℚ; even integers construct an explicit listing  (sequence) of all elements
Uncountable no bijection with ℕ is possible ℝ; any interval  (a, b);  𝒫(ℕ) Cantor's diagonal argument  (or Cantor's theorem)

Cardinality Notation

Notation

Cardinality Notation

Size gets a bar pair, infinity gets a Hebrew letter, and the continuum gets a Fraktur one — three generations of marks for one question: how many members? The variant zoo (card⁡\operatorname{card}, #\#, n(A)n(A)) rides along.
The braces, ∈\in, ∅\varnothing and set-builder come from set theory basics; the power set P(A)\mathcal{P}(A) and 2A2^A behind the continuum from the subsets page; the double-struck ℕ–ℝ chain likewise.
∣A∣|A|
the cardinality of A
The bar pair around a set counts it: ∣A∣=3|A| = 3 for A={1,2,3}A = \{1, 2, 3\} — Definition of Cardinality above. The same fence with a different tenant: on numbers the bars mean absolute value, on sets they count.
CasesThe variant zoo by dialect: card⁡(A)\operatorname{card}(A) in formal set theory, #A\#A in combinatorics, n(A)n(A) in school probability texts, ∥A∥\|A\| occasionally — all the same question; this site keeps the bars.
Do not confuseA number's magnitude. ∣−5∣=5|{-5}| = 5 but ∣{−5}∣=1|\{-5\}| = 1 — bars around the number measure distance, bars around the braces count members; the inner braces flip the meaning entirely.
ℵ0\aleph_0
aleph-null; aleph-nought
The first infinite cardinal: ∣N∣=ℵ0|\mathbb{N}| = \aleph_0 — the size shared by every countably infinite set, as Countable Sets above establishes. The aleph is mathematics' one standard Hebrew letter, Cantor's own choice; the mathematical keyboard carries it, along with the ℶ\beth that follows it.
CasesThe subscript starts a ladder — ℵ0,ℵ1,…\aleph_0, \aleph_1, \ldots enumerate ever-larger infinities; ∣Z∣=∣Q∣=ℵ0|\mathbb{Z}| = |\mathbb{Q}| = \aleph_0 despite appearances, the working surprise of the countability arguments above.
Do not confuseThe infinity symbol. ℵ0\aleph_0 is a cardinal — a size — while the ∞\infty of limit notation is a direction of growth; the two never interchange, and ℵ0+1=ℵ0\aleph_0 + 1 = \aleph_0 obeys arithmetic ∞\infty was never given.
c=2ℵ0\mathfrak{c} = 2^{\aleph_0}
the continuum; two to the aleph-null
The size of the reals: ∣R∣=c|\mathbb{R}| = \mathfrak{c}, in Fraktur type — the blackletter font also seen on the real-part marks ℜ\Re and ℑ\Im. The exponent spelling 2ℵ02^{\aleph_0} reads it as a power-set size, via ∣P(A)∣=2∣A∣|\mathcal{P}(A)| = 2^{|A|} from the subsets page.
CasesStrictness is the point: ℵ0<c\aleph_0 < \mathfrak{c} — Uncountable Sets above proves the gap with Cantor's diagonal; every interval (a,b)(a, b) already has full cardinality c\mathfrak{c}.
Do not confuseA plain letter c. The Fraktur stroke is the reservation — roman cc is a free constant; and 2ℵ02^{\aleph_0} is not "a huge finite power of two" but a set-sized exponent, legal only in cardinal arithmetic.

Comparing Cardinalities


    Cardinalities are compared using functions between sets:

  • ∣A∣=∣B∣|A| = |B| when a bijection exists between AA and BB

  • ∣A∣≤∣B∣|A| \leq |B| when an injection (one-to-one function) exists from AA to BB

  • ∣A∣<∣B∣|A| < |B| when ∣A∣≤∣B∣|A| \leq |B| and ∣A∣≠∣B∣|A| \neq |B|

  • THEOREMCantor–Schröder–Bernstein Theorem
    The Cantor-Schröder-Bernstein theorem states: if ∣A∣≤∣B∣|A| \leq |B| and ∣B∣≤∣A∣|B| \leq |A|, then ∣A∣=∣B∣|A| = |B|.

    Cantor's theorem establishes a fundamental inequality for any set AA:

    Cantor Theorem
    ∣A∣<∣P(A)∣|A| < |\mathcal{P}(A)|
    Learn more about this formula: Cantor Theorem →


    The power set always has strictly greater cardinality than the original set. For finite sets, this is immediate: 2n>n2^n > n. For infinite sets, the proof uses a diagonal argument similar to the uncountability of R\mathbb{R}.

    This theorem implies there is no largest cardinality — given any set, its power set is strictly larger, producing an endless hierarchy of infinite sizes.
Relation Meaning Witnessed by
|A| = |B| A and B have the same cardinality a bijection  A → B
|A| ≤ |B| A is no larger than B an injection  A → B
|A| < |B| A is strictly smaller than B an injection exists, but no bijection does

Summary: A Hierarchy of Cardinalities


The sets covered above arrange themselves into a strict hierarchy of sizes. The table below collects the major rungs — empty, finite, countably infinite, the continuum, and beyond — with a representative set at each level. Cantor's theorem guarantees the hierarchy never ends: for every set, its power set is strictly larger, producing an unbounded tower of cardinalities.
Cardinality Description Representative set(s)
0 empty ∅  (the only set with this cardinality)
finite n  (n ∈ ℕ) bounded element count {1, 2, ..., n};  the English alphabet  (n = 26)
ℵ0  (aleph-null) countably infinite — the smallest infinite cardinality ℕ, ℤ, ℚ;  the even integers
𝔠 = 2ℵ0  (continuum) uncountable; the size of the real line ℝ;  any interval  (a, b);  𝒫(ℕ)
2𝔠,  2(2𝔠),  ... strictly larger uncountable cardinalities  (by Cantor's theorem) 𝒫(ℝ);  𝒫(𝒫(ℝ));  the hierarchy continues without end
DownloadPNG2×PDF
Before you read
A strict hierarchy of sizes
The sets on this page arrange themselves by size, from the empty set up through the finite sets, the countable infinity, the continuum, and beyond.
largestcardinalitysmallest
Beyond the continuum2c2^{\mathfrak{c}}: P(R)\mathcal{P}(\mathbb{R})
The continuumc=2ℵ0\mathfrak{c} = 2^{\aleph_0}: R\mathbb{R}, any interval
Countably infiniteℵ0\aleph_0: N\mathbb{N}, Z\mathbb{Z}, Q\mathbb{Q}
Finitenn: {1,2,…,n}\{1, 2, \ldots, n\}
Empty00: ∅\varnothing
Takeaway
The tower never ends
Cantor's theorem guarantees it: for every set, its power set is strictly larger, so P(R)\mathcal{P}(\mathbb{R}), P(P(R))\mathcal{P}(\mathcal{P}(\mathbb{R})), … keep climbing without end.
A hierarchy of cardinalities·/set-theory/cardinalityLearn Math Class

Cardinality FAQ

How do you find the cardinality of a union of two sets?

+
Add the sizes and subtract the overlap: |A ∪ B| = |A| + |B| − |A ∩ B|. The subtraction is needed because elements lying in both sets would otherwise be counted twice. When the sets are disjoint the overlap is empty and the sizes simply add. Adjust the circles on the two-set Venn explorer to watch the correction term appear and vanish.Read more →

Are the rational numbers countable?

+
Yes. Arrange the positive rationals in a grid by numerator and denominator, then traverse it diagonally — every fraction is reached at some finite step, so the whole set can be listed as a sequence. That listing is a bijection with the natural numbers, making ℚ countably infinite despite sitting densely inside the real line.Read more →

What is Cantor's diagonal argument?

+
Suppose every real number between 0 and 1 could be listed. Build a new number whose n-th decimal digit differs from the n-th digit of the n-th number on the list. This number differs from every entry in at least one place, so it is missing from the list. The assumption fails, and the reals are therefore uncountable.Read more →

Can two infinite sets have different sizes?

+
Yes. The naturals and the reals are both infinite, but no bijection between them exists — Cantor's diagonal argument rules one out. ℕ has cardinality ℵ₀ and ℝ has cardinality 𝔠, with ℵ₀ < 𝔠. Sizes are compared by functions: an injection from A to B gives |A| ≤ |B|, and a bijection gives equality.Read more →

What is the cardinality of the real numbers?

+
The reals have cardinality 𝔠, called the continuum, also written 2^ℵ₀ because it equals the size of the power set of ℕ. It is strictly larger than ℵ₀, the size of the naturals. Every interval (a, b) has this same cardinality — a bijection maps any open interval onto the whole real line.Read more →

Is there a largest infinity?

+
No. Cantor's theorem says |A| < |P(A)| for every set A — the power set is always strictly larger. Apply it to ℝ to get a bigger infinity, then apply it again, and again. The result is an endless tower of cardinalities with no top. For finite sets the same theorem is just the observation that 2ⁿ > n.Read more →