🌀 Kids · Math
📅 May 2026 ⏱ ~6 min read 🟢 All ages

What Is a Fractal?

A fractal is a pattern that looks the same no matter how closely you zoom in. Nature is full of them — coastlines, snowflakes, ferns, blood vessels and galaxies all have fractal structure. Mathematics can generate infinitely detailed fractal shapes with just a few lines of code.

Self-Similarity

The defining property of a fractal is self-similarity: each part of the pattern looks like a smaller copy of the whole. If you zoom into a fractal image, you keeps seeing the same detail repeated at ever smaller scales — the complexity never runs out.

Mathematicians say a fractal is exactly self-similar if every piece is a perfect scaled copy, or statistically self-similar if the statistical properties are the same at all scales (as in the coastline of Britain).

How long is a coastline? The British mathematician Lewis Fry Richardson noticed that measured coastline length increases as you use a smaller ruler. This is because more and more bays and peninsulas become visible. A fractal has an effectively infinite perimeter!

Classic Fractal Examples

Sierpiński Triangle

Start with an equilateral triangle. Remove the central triangle (connect the midpoints of each side). Repeat with each of the three remaining triangles. Keep going infinitely — you get the Sierpiński triangle. It has zero area but infinite perimeter (at least in theory).

Koch Snowflake

Start with an equilateral triangle. Replace the middle third of each side with a smaller equilateral triangle pointing outward. At each step you add more spikes. The perimeter grows without limit but the area converges to a finite value (8/5 times the original triangle area).

Cantor Set

Start with a line segment. Remove the middle third. Remove the middle third of each remaining piece. Repeat. You end up with an infinite set of points that has zero length — but still contains infinitely many points.

The Mandelbrot Set

The most famous fractal is the Mandelbrot set, discovered by Benoît Mandelbrot in the 1980s. It is defined by a simple rule applied to complex numbers:

z₀ = 0, zₙ₊₁ = zₙ² + c

For each point c in the complex plane, repeatedly apply the formula. If the value |z| stays bounded (never grows to infinity), c is in the Mandelbrot set (coloured black). If it escapes to infinity, colour c based on how quickly it escapes. The result is an infinitely complex boundary that reveals new shapes at every zoom level.

Fun fact: The boundary of the Mandelbrot set has a fractal dimension of exactly 2 — even though it is a 1D curve! This means it is so infinitely wrinkled that it fills an area.

Fractal Dimension

Ordinary geometry uses whole-number dimensions: a point is 0D, a line 1D, a surface 2D, a solid 3D. Fractals can have fractional dimensions!

The Hausdorff dimension D of a self-similar fractal made of N copies scaled by factor r is:

D = log(N) / log(1/r)

Fractals in Nature

Fractal-like structures appear throughout the natural world because they solve engineering problems efficiently:

Build a Fractal Tree in 20 Lines

A fractal tree is one of the simplest fractals to program. Each branch splits into two children at some angle — the same rule applied recursively:

function branch(ctx, x, y, len, angle, depth) {
  if (depth === 0) return;
  // Calculate end point of this branch
  const x2 = x + len * Math.cos(angle);
  const y2 = y - len * Math.sin(angle); // y inverted in canvas
  ctx.beginPath();
  ctx.moveTo(x, y);
  ctx.lineTo(x2, y2);
  ctx.stroke();
  // Recurse: two children, each 70% the length, rotated ±25°
  branch(ctx, x2, y2, len * 0.7, angle + 0.44, depth - 1);
  branch(ctx, x2, y2, len * 0.7, angle - 0.44, depth - 1);
}
// Call with depth=11 for a detailed tree
branch(ctx, 400, 600, 120, Math.PI / 2, 11);
Try it: Open the Pythagoras Tree simulation to see an interactive fractal tree you can reshape with sliders. The Mandelbrot Set simulation lets you zoom infinitely into the fractal boundary.
🌿 Open Fractal Tree →