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

Cardinalitythe number of elements in a set
Finite Seta set with a bounded element count
Infinite Seta set that cannot be matched with any finite count
Countable Seta set whose elements can be listed in a sequence
Uncountable Seta set too large to be listed sequentially
Equivalent Setssets related by having the same cardinality
Power Setalways 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:

=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 nNn \in \mathbb{N} such that:

    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:

  • 2626

  • 2020 is {2,3,5,7,11,13,17,19}\{2, 3, 5, 7, 11, 13, 17, 19\} with cardinality 88

  • 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
    AB=A+BAB|A \cup B| = |A| + |B| - |A \cap B|
    Learn more about this formula: Inclusion-Exclusion - Two Sets →


    The correction term AB|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
    ABC=A+B+CABACBC+ABC|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
    AB=A+Bwhen AB=|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.

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:

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:

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.

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).

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.

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 202^{\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}.
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=20\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 202^{\aleph_0} reads it as a power-set size, via P(A)=2A|\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 202^{\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

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

  • A<B|A| < |B| when AB|A| \leq |B| and AB|A| \neq |B|

  • The Cantor-Schröder-Bernstein theorem states: if AB|A| \leq |B| and BA|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
𝔠 = 20  (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

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 →