Can a Curve Fill a Square?
A curve is one-dimensional. A square is two-dimensional. So it seems impossible that a single continuous curve could pass through every point of a square.
Surprisingly, it can.
There exists a continuous function
whose image is the entire unit square. In other words, as the parameter moves continuously from 0 to 1, the point eventually reaches every point of the square.
Such a curve is called a space-filling curve.
The Hilbert Curve
One of the most beautiful examples is the Hilbert curve. Instead of trying to draw the final curve immediately, we construct a sequence of increasingly complicated polygonal curves.
Start with a square. Divide it into four equal smaller squares and connect their centers in an order that forms a U-shaped path.
This is the first approximation.
For the second approximation, divide each of the four squares into four smaller squares. We now have
small squares. Inside each group of four, place a suitably rotated or reflected copy of the previous pattern and connect the pieces.
Repeat the process again and again.
At stage , the square has been divided into
small squares, each having side length
The Squares Become Tiny
The important feature of the construction is not merely that the number of squares increases. Their size simultaneously decreases to zero.
A small square at stage has side length
so its diameter is
Therefore,
The construction is examining the square on smaller and smaller scales.
Why Does the Limit Fill the Square?
Take any point in the unit square.
At the first stage, belongs to at least one of the four small squares. Call one such square .
At the second stage, choose one of the smaller squares containing and call it . Continue in this way.
We obtain nested squares
containing , while
Since the squares shrink to a point, their intersection is precisely
The Hilbert construction assigns corresponding nested parameter intervals
whose lengths also tend to zero. Their intersection therefore determines a parameter value . For this value,
But was an arbitrary point of the square. Thus the limiting curve reaches every point of the square.
A Curve Whose Image Has Area 1
This produces a remarkable conclusion.
The domain of the Hilbert curve is the interval , but its image is
Consequently, the image of this continuous curve has area
This is very different from an ordinary smooth curve, whose area in the plane is zero.
What Happens to the Length?
The polygonal approximations also reveal something interesting.
At stage , the curve visits small squares. The characteristic distance between neighboring points is of order
Therefore the total length is of order
As , this quantity tends to infinity.
Thus the approximations stay inside a square of area 1, but their lengths grow without bound.
Does This Mean an Interval and a Square Are the Same?
No.
The Hilbert curve is continuous and onto, but it is not one-to-one. Different parameter values can correspond to the same point of the square.
This distinction is essential. There is no continuous one-to-one correspondence with a continuous inverse between an interval and a square.
The space-filling curve does something subtler: it continuously folds an interval over itself infinitely many times until its image covers the entire square.
A Dimensional Clue
There is another way to see why the numbers in the construction fit together so naturally.
When lengths are reduced by a factor of 2, the number of pieces increases by a factor of 4:
If we informally ask for a dimension satisfying
then
This scaling behavior gives a hint of how a construction beginning with a one-dimensional parameter can produce an image that occupies a two-dimensional region.
Why Space-Filling Curves Are Useful
Space-filling curves are not only mathematical curiosities. Hilbert-type orderings are useful whenever multidimensional data must be arranged in a one-dimensional sequence.
The Hilbert ordering has an important locality property: points that are close along the curve tend to remain relatively close in space. This idea appears in spatial indexing, image processing, databases, and algorithms for organizing multidimensional data.
A construction that originally seemed almost paradoxical therefore connects pure mathematics with practical computation.
The Main Idea
The Hilbert curve demonstrates how misleading our finite-dimensional intuition can be when a limiting process is repeated infinitely many times.
Every finite approximation is just an ordinary polygonal curve. None of these approximations fills the square.
But the subdivisions become arbitrarily small, and in the limit every point of the square is reached.
A continuous image of a one-dimensional interval can therefore fill an entire two-dimensional square.

Continue exploring: Another surprising example of how strange continuous functions can be: Can a Function Be Continuous Everywhere but Differentiable Nowhere?
Not all interesting curves are as unusual as space-filling curves. Some are designed to create smooth, controllable shapes using only a few points. Discover how this works in Bézier Curves: How Four Points Create Beautiful Shapes .
Leave a Reply