Here is a fact that will quietly rearrange your intuition about infinity, if you let it: there are more real numbers than rational numbers. Not just "more of both kinds," but a different, larger kind of infinity. The rationals — even though there are infinitely many of them, and they are densely packed into every inch of the number line — can be put on a numbered list: rational #1, rational #2, rational #3, and so on, hitting every rational exactly once. The real numbers cannot be listed this way. No matter how cleverly you try, you will always miss some reals.

This distinction — countable versus uncountable — is the first big surprise of mathematical infinity. Store it as a mental landmark.

"Countable" means listable

A set is countable if you can match its elements up one-to-one with the natural numbers 1, 2, 3, \dots. In other words, you can make a list where every element of the set appears somewhere, labelled by a natural number.

Why this is the right definition: a set that can be listed has the same "counting size" as \mathbb{N}. If I point at rational #42, you know which one I mean. "Countable infinite" is the size of \mathbb{N} itself — also called \aleph_0 (aleph-null) in formal language.

The integers \mathbb{Z} = \{\dots, -2, -1, 0, 1, 2, \dots\} are countable, which is already a little odd — they have "twice as many" members as the naturals, sort of, but you can still list them:

0, \; 1, \; -1, \; 2, \; -2, \; 3, \; -3, \; \dots

Every integer shows up, labelled by a natural number position on the list.

The rationals are also countable — and this is the shock. There are infinitely many rationals between any two integers, and yet you can still list every single rational.

Cantor's trick for the rationals

Georg Cantor showed in 1874 how to list all the positive rationals. Arrange them in a grid, where row p and column q holds \dfrac{p}{q}:

\begin{array}{c|ccccc} & 1 & 2 & 3 & 4 & 5 & \dots \\ \hline 1 & 1/1 & 1/2 & 1/3 & 1/4 & 1/5 & \dots \\ 2 & 2/1 & 2/2 & 2/3 & 2/4 & 2/5 & \dots \\ 3 & 3/1 & 3/2 & 3/3 & 3/4 & 3/5 & \dots \\ 4 & 4/1 & 4/2 & 4/3 & 4/4 & 4/5 & \dots \\ \vdots & & & & & & \ddots \end{array}

Every positive rational appears somewhere in this grid. Now walk along the diagonals, skipping any fraction already seen in lowest terms:

\dfrac{1}{1}, \; \dfrac{1}{2}, \; \dfrac{2}{1}, \; \dfrac{1}{3}, \; \dfrac{3}{1}, \; \dfrac{1}{4}, \; \dfrac{2}{3}, \; \dfrac{3}{2}, \; \dfrac{4}{1}, \dots

(We skipped \tfrac{2}{2} = 1, already counted.) Every positive rational appears exactly once on this list, labelled by a natural number position. To include negatives and zero, interleave:

0, \; \dfrac{1}{1}, \; -\dfrac{1}{1}, \; \dfrac{1}{2}, \; -\dfrac{1}{2}, \; \dfrac{2}{1}, \; -\dfrac{2}{1}, \; \dots

So \mathbb{Q} is countable. Despite density, despite there being infinitely many rationals between any two other rationals, you can enumerate them all.

Cantor's diagonal walk through the rationals gridA five by five grid of fractions p over q, with rows labelled 1 through 5 for the numerator and columns labelled 1 through 5 for the denominator. A red path weaves along the antidiagonals: one over one, one over two, two over one, one over three, three over one, one over four, two over three, three over two, four over one. The walk gives each rational a natural-number position. Caption reads: every rational appears exactly once along the walk.1/11/21/31/41/52/12/22/32/42/53/13/23/33/43/54/14/24/34/44/55/15/25/35/45/5Diagonal walk: 1/1, 1/2, 2/1, 1/3, 2/2 (skip), 3/1, …Every positive rational appears exactly once — so ℚ is countable.
Cantor arranged fractions in a grid and walked the antidiagonals. Every rational appears exactly once in this walk, giving each one a natural-number position. Even though the rationals are dense, they can still be listed.

The reals cannot be listed

Now the real numbers \mathbb{R}. Can you list every real? Cantor proved: no. This is the famous diagonal argument.

Suppose you have a list of every real number between 0 and 1, one real per row:

\begin{array}{r|l} r_1 & 0.\mathbf{a_{11}} a_{12} a_{13} a_{14} \dots \\ r_2 & 0.a_{21} \mathbf{a_{22}} a_{23} a_{24} \dots \\ r_3 & 0.a_{31} a_{32} \mathbf{a_{33}} a_{34} \dots \\ r_4 & 0.a_{41} a_{42} a_{43} \mathbf{a_{44}} \dots \\ \vdots & \vdots \end{array}

(Where a_{ij} is the j-th digit of the i-th real in the list.)

Construct a new real x = 0.x_1 x_2 x_3 \dots by the rule: x_i is any digit different from a_{ii}. Say, x_i = 5 if a_{ii} \neq 5, else x_i = 6.

Claim: x is not on the list.

Why? x differs from r_1 in the first digit (we chose x_1 \neq a_{11}). x differs from r_2 in the second digit. x differs from r_i in the i-th digit, for every i. So x cannot equal r_i for any i. But x is a real between 0 and 1, and we assumed the list contained every such real. Contradiction.

Conclusion: no list of all reals exists. \mathbb{R} is uncountable.

Why the diagonal argument is so robust: it works for any proposed list, because the construction of x uses the list itself. The "diagonal" picks one digit from each row and swaps it, guaranteeing the result disagrees with every row in at least one place. There is no way to patch the list to include x, because the moment you add x as a new row, you can run the diagonal argument again and produce a new missing real.

What this means for the number line

The rationals are countable — infinitely many, but listable — while the reals are uncountable — infinitely many, unlistable. The reals are a "larger" infinity.

And since \mathbb{R} = \mathbb{Q} \cup (\mathbb{R} \setminus \mathbb{Q}) (rationals and irrationals together), and the rationals are countable, the irrationals must be uncountable. If the irrationals were countable, the union of two countable sets would also be countable — but \mathbb{R} is not countable. So the irrationals account for the entire "excess" uncountability of the reals.

In fact, in a precise measure-theoretic sense, if you pick a real number at random from the interval [0, 1], the probability that it is rational is exactly zero. Almost every real is irrational. The rationals you grew up with are a vanishingly thin scattering of points inside a much vaster, continuous sea.

Why "probability zero": the rationals are a countable set of points, each occupying zero length on the number line. Countable unions of zero-length sets still have zero total length. So the rationals — taken all together — occupy zero length inside [0, 1], while the whole interval has length 1. The irrationals occupy all of that length.

The file-this-carefully takeaway

Three things about infinity worth carrying with you, triggered by this one result:

  1. Infinity comes in different sizes. The naturals, integers, and rationals all have the same countable infinity size \aleph_0. The reals have a bigger size, 2^{\aleph_0}, called the continuum.

  2. Density does not mean uncountability. The rationals are dense (between any two rationals is another), yet countable. Density is a topological property; countability is a cardinality property. They are independent.

  3. Most of the real numbers have no name. You can name \pi, e, \sqrt{2}, \log_2 5, \dots and all algebraic numbers, and every rational. There are countably many such named numbers. The rest — uncountably many — are real numbers whose decimal expansions cannot be described by any finite rule at all. They just are. They fill the number line.

A first taste of "uncountable" intuition

Pick a real x at random from [0, 1] by rolling a 10-sided die forever and using the digits as the decimal expansion. What is the probability x is rational?

For x to be rational, its decimal must eventually repeat. That requires the infinite random digit sequence to fall into a repeating pattern — which happens with probability zero. So almost surely, x is irrational. In fact almost surely, x is a real that no human will ever name.

That is uncountability at work. If you could list all reals, "choose a real at random" would be no different from "choose a natural number at random." But you cannot list them, and the random-digit construction lands on one of the unlistable ones with probability 1.

This is the first result in the subject of cardinality, which extends to later topics in real analysis, measure theory, and set theory. For a Class 9 or Class 11 student, no calculation depends on uncountability — but the mental image does: the number line is mostly irrational, the rationals are a sparse dusting, and no list captures all the reals. File this, and infinity will stop feeling like a single monolithic idea.

Related: Number Systems · Are Irrationals Rare? They Outnumber Rationals · Zooming the Number Line: Rationals Density · Dense But Full of Holes: The Mental Model of the Rationals