On this page
A coastline is a curve, but it wiggles so much at every scale that it starts to behave a little like an area. Fractal dimension puts a number on that in-between behaviour, and box counting measures it with a grid and a pencil.
What does fractal dimension actually measure?
A line segment splits into 2 copies of itself at half size, a square into 4 and a cube into 8. The number of copies N and the scale factor s obey N = s^D, where D is the familiar dimension: 2 = 2^1, 4 = 2^2, 8 = 2^3.
Taking logs gives the self-similarity dimension: D = log N / log s. For ordinary shapes it returns whole numbers. For fractals it does not. The values below are listed in Wikipedia's list of fractals:
The Koch curve is made of 4 copies of itself, each one-third the size, so its dimension is log 4 / log 3 = 1.2619.
The Sierpiński triangle is made of 3 copies, each half the size, so its dimension is log 3 / log 2 = 1.585.
The Cantor set keeps 2 pieces, each one-third the size, so its dimension is log 2 / log 3 = 0.6309.
The Koch curve is more than a line but less than an area; the Cantor set is more than a scatter of points but less than a line, which fits the puzzle in our post on why the Cantor set has length zero yet uncountably many points.
Why does a coastline have a dimension between 1 and 2?
Lewis Fry Richardson noticed that Portugal reported its border with Spain as 987 km while Spain reported 1214 km, as the coastline paradox article records. The two countries were using rulers of different lengths. Richardson found that the shorter the ruler, the longer the measured length.
His empirical rule is usually written L(ε) = F ε^(1 − D), where ε is the ruler length and D is a constant for each coastline. D is about 1.25 for the west coast of Great Britain and about 1.02 for the coast of South Africa, per the same article, which cites Mandelbrot's book The Fractal Geometry of Nature.
In 1967 Benoit Mandelbrot read D as a dimension. His Science paper, How Long Is the Coast of Britain?, argues that many geographical curves are statistically self-similar, so their wiggliness can be described by a fractional dimension that exceeds the value 1 of ordinary curves.
Halve the ruler and the measured length is multiplied by 2^(D − 1). For Britain's west coast that is 2^0.25, about 1.19, so roughly 19% more coast appears. For South Africa it is 2^0.02, about 1.014, barely any change.
How does box counting work?
Real shapes are not made of exact copies, so you cannot read off N and s. Instead, lay a grid of boxes of side ε over the shape and count N(ε), the boxes that contain part of it. The box-counting (Minkowski–Bouligand) dimension is the limit of log N(ε) / log(1/ε) as ε shrinks. In practice you plot log N against log(1/ε) and read the slope.
What does a box count by hand look like?
The Sierpiński triangle is the limiting shape of Pascal's triangle modulo 2, as the list of fractals notes. Write the first 16 rows of Pascal's triangle on a 16 × 16 grid, one number per square, each row starting at the left edge, and shade every odd number.
Grid of 2 × 2 boxes over the picture: 3 boxes contain shading.
Grid of 4 × 4: 9 boxes.
Grid of 8 × 8: 27 boxes.
Grid of 16 × 16: 81 boxes, one per odd entry.
Each time the boxes halve, the count triples. The slope between the last two grids is log(81/27) / log(16/8) = log 3 / log 2 = 1.585, the same as the self-similarity dimension. A filled triangle would give slope 2.
How can you measure a fractal dimension yourself?
Try this with a printed map of any rocky coastline, such as the Konkan coast.
Trace the coastline onto plain paper.
Draw grids with boxes of 4 cm, 2 cm, 1 cm and 0.5 cm on tracing sheets.
For each grid, count the boxes the line passes through.
Write down log N and log(1/ε) for each grid, in one base throughout.
Plot the points and draw the best straight line. Its slope is your estimate of D.
Sanity check: a coastline should give a slope between 1 and 2; near 1 means a smooth shore.
Your number is an estimate over the box sizes you used. For more, see our explainer on the Mandelbrot set and our guide to the Class 8 Ganita Prakash chapter on fractals, nets and views.
The ideas underneath, logarithms, limits and geometric sequences, each have a lesson in the Fermi Concept Library, so you can fill a gap before you start counting boxes.



