Take the interval [0, 1]. On a page it is a simple segment, a finger's width long. Inside it lives an entire universe: every rational fraction p/q with 0 \le p \le q in lowest terms, and every irrational number between 0 and 1 — algebraic irrationals like \tfrac{1}{\sqrt{2}} and \tfrac{\sqrt{3}}{2}, transcendental ones like \tfrac{\pi}{4} and \tfrac{1}{e}, and uncountably many more whose decimal expansions no human will ever write down in full.
The widget below lets you zoom. At the lowest zoom level you see a handful of rationals with small denominators — the halves, thirds, quarters, fifths. As you crank the zoom up, rationals with bigger denominators come into view. In the gaps between them, a few famous irrationals quietly mark their spots. The more you zoom, the more you see of both — but no matter how deep you go, the irrationals always outnumber the rationals.
Watch the interval fill up
Reading the widget
At zoom level z = 0, you see the full unit interval. Blue ticks stand at \tfrac{1}{6}, \tfrac{1}{5}, \tfrac{1}{4}, \tfrac{1}{3}, \tfrac{2}{5}, \tfrac{1}{2}, \tfrac{3}{5}, \tfrac{2}{3}, \tfrac{3}{4}, \tfrac{4}{5}, \tfrac{5}{6} — the rationals in lowest terms with denominator at most 6. The taller the tick, the smaller the denominator; \tfrac{1}{2} is the tallest, because in a combinatorial sense it is the "simplest" fraction in the window. Two red ticks already poke out: \tfrac{1}{\sqrt{2}} \approx 0.7071 and \tfrac{\sqrt{3}}{2} \approx 0.8660 wait, that one is outside the starting window's centre — some irrationals only appear as you zoom.
Push the slider to z = 1. The window halves to [0.25, 0.75]. New blue ticks arrive — rationals like \tfrac{3}{8}, \tfrac{5}{8}, \tfrac{4}{7}, \tfrac{3}{7}, whose denominators fit the new cap. The red tick for \tfrac{\pi}{4} \approx 0.7854 comes into view, so does \ln 2 \approx 0.6931, and \tfrac{1}{\sqrt{2}} is still there. At z = 2 the window is [0.375, 0.625], width 0.25, and a dozen more rationals crowd in. By z = 6, the window has width 2^{-6} \approx 0.0156 — and yet between the two endpoints there are still infinitely many rationals and infinitely many irrationals. You are seeing only a thin sample.
Why rationals are "dense"
A set S \subset \mathbb{R} is dense in the real line if, between any two real numbers a < b, you can find an element of S. For the rationals, the proof is a one-liner: the Archimedean property guarantees that some n \in \mathbb{N} satisfies n(b - a) > 1, so the interval (na, nb) has length greater than 1 and therefore contains at least one integer m. Divide by n: the rational \tfrac{m}{n} lies in (a, b). Why: if an open interval on the real line has length strictly greater than 1, it must contain an integer — because consecutive integers are exactly 1 apart, and any open interval wider than that covers at least one of them completely.
Repeating the argument, you can put a rational between a and \tfrac{m}{n}, and another between \tfrac{m}{n} and b, and then more between each of those. Between any two real numbers, there are infinitely many rationals. This is what the widget is showing at every zoom level: halve the window, and the rationals do not thin out — they reappear with bigger denominators.
Why irrationals are also dense — and more numerous
The same argument, slightly modified, proves that the irrationals are dense too. Given a < b, pick any rational \tfrac{m}{n} in (a - \sqrt{2}, b - \sqrt{2}) using the density of rationals, then add \sqrt{2}: the result \tfrac{m}{n} + \sqrt{2} is irrational (rational plus irrational is irrational) and lies in (a, b). So between every two reals there is an irrational, and repeating the argument, infinitely many irrationals.
At this point the two species seem tied — both dense, both infinite in every interval. But one of them is infinitely larger than the other. The rationals are countable: you can line them up in a list, one after another, as shown in the companion article Countable Rationals, Uncountable Reals. The irrationals are uncountable: no such list exists. In any interval (a, b) of positive length, the rationals form a countably infinite subset — a vanishingly thin layer — while the irrationals fill the rest, which has the same "size" as all of \mathbb{R}. For a formal version, see Irrationals Outnumber Rationals.
What the widget is and is not showing
The picture on your screen is a finite approximation. At every zoom level the widget draws only finitely many ticks — typically a few dozen rationals and a handful of irrationals. The mathematical reality is that both sets are infinite inside every window, but no screen could display uncountably many ticks. What you can see is the trend: as the denominator cap rises, more and more rationals show up. As the zoom deepens, more irrationals come into the window's range. Neither set ever runs out.
There is one subtlety the widget cannot faithfully display. Between any two rationals you can see on the screen, there are uncountably many irrationals — but the widget only knows the eight irrationals I hard-coded. In principle, for any tiny sub-interval of a zoomed-in window, there should be another \sqrt{\text{something}} + \text{rational} sitting inside, and another, and another, uncountably many. The widget shows a static "menu" of irrationals; the real interval contains every real number, rational or not.
The connection to completeness
This interleaving is why the real number system needed to be built carefully. If you tried to work only with the rationals, bounded sequences like 1, 1.4, 1.41, 1.414, 1.4142, \ldots — each a rational approximation to \sqrt{2} — would have no limit inside the system. The rationals are dense but not complete: limits of rational sequences can escape into the gaps. Filling in all those gaps with irrationals is exactly what produces \mathbb{R} from \mathbb{Q}. See Real Numbers — Properties for the full story of completeness, and Rationals Are Dense But Have Holes for a sharper version of this failure.
A hand-check to try
Pick z = 4. The window is [0.46875, 0.53125], width 0.0625. Which rationals with q \le 20 should sit inside? Multiply the endpoints by q and look for integers: for q = 19, the endpoints become 8.906 and 10.094, so p = 9 and p = 10 both work — \tfrac{9}{19} \approx 0.4737 and \tfrac{10}{19} \approx 0.5263. Confirm in the widget at z = 4: both ticks should be present. For q = 17, the endpoints are 7.97 and 9.03, so p = 8 and p = 9 work: \tfrac{8}{17} \approx 0.4706 and \tfrac{9}{17} \approx 0.5294. This is how denominators "stack" as you zoom — bigger q lets finer rationals slip into the window.
The takeaway
The rationals are dense, the irrationals are dense, and they interleave at every scale. No matter how far you zoom into [0, 1], you will always find rationals and irrationals side by side. But the irrationals are uncountably many more — between any two rationals you can see, there are uncountably many irrationals you cannot. The "gap-free" real line is really a fine mist of rationals scattered through an ocean of irrationals.
Related: Real Numbers — Properties · Rationals Are Dense But Have Holes · Irrationals Between the Rationals · Countable Rationals, Uncountable Reals · A Zoomable Number Line: Rationals and Irrationals Densely Filling the Gaps · Zooming Number Line — Rationals Density