This calculator computes the self-similar (Hausdorff) fractal dimension of an ideal fractal using the classic scaling relationship between the number of self-similar pieces and their linear scaling ratio. You enter:
The tool then returns the fractal dimension D, which may be non-integer (for example, 1.26). This helps quantify how “space-filling” or detailed a self-similar structure is as you zoom in.
Classical geometry assigns integer dimensions to simple shapes: a line is 1-dimensional, a plane is 2-dimensional, and ordinary 3D space is 3-dimensional. Fractals often do not fit neatly into this scheme. They can be more complex than a line but less than a filled plane, giving them a fractional or fractal dimension such as 1.26 or 1.58.
Intuitively, the fractal dimension measures how the amount of detail, or the number of pieces needed to cover a set, changes as you refine your scale of observation. For many self-similar fractals, this scaling is regular enough that a simple formula relates dimension, number of pieces, and linear scale factor.
For an ideal self-similar fractal that can be decomposed into N smaller copies of itself, each scaled down by a linear factor r (with 0 < r < 1), the self-similar (and, under suitable conditions, Hausdorff) dimension D is defined by the relationship:
This says that the number of self-similar copies equals the scale factor raised to the power of the dimension. Solving this equation for D gives:
D = log(N) / log(1 / r)
Here, log can be any logarithm base (natural log, base 10, etc.) as long as the same base is used in both numerator and denominator. The calculator uses natural logarithms internally, but the result is independent of the base.
A higher value of D indicates that the set becomes more space-filling as you zoom in. For example, a plane-filling set has dimension 2, while many classic fractal curves have a dimension strictly between 1 and 2.
Consider a line segment broken into three equal smaller segments arranged end to end. Each segment is a scaled copy of the original.
Plugging into the formula:
D = log(3) / log(1 / (1/3)) = log(3) / log(3) = 1
This matches the familiar idea that a line is 1-dimensional.
Take a square, and divide it into a 2 × 2 grid of equally sized smaller squares, all of which are kept.
Then:
D = log(4) / log(1 / (1/2)) = log(4) / log(2) = 2
So the figure fills a 2-dimensional region, as expected.
The Koch curve is constructed by repeatedly replacing each line segment with four segments, each one third as long, forming a characteristic spike.
Thus:
D = log(4) / log(1 / (1/3)) = log(4) / log(3) ≈ 1.2619
This value lies between 1 (a regular line) and 2 (a filled area), reflecting that the curve is rougher than a line but does not fully fill the plane.
The table below compares several common self-similar sets and how their parameters affect the computed dimension.
| Structure | N (number of pieces) | r (scaling ratio) | Computed fractal dimension D |
|---|---|---|---|
| Straight line segment | 3 | 1/3 | 1 |
| Filled square | 4 | 1/2 | 2 |
| Koch curve | 4 | 1/3 | ≈ 1.2619 |
| Sierpiński triangle | 3 | 1/2 | ≈ 1.5849 |
| Sierpiński carpet | 8 | 1/3 | ≈ 1.8928 |
This illustrates how changing N and r influences the dimension:
After computing the fractal dimension with this tool, you can interpret the value in broad terms:
In many scientific and engineering applications, fractal dimension serves as a compact measure of complexity, irregularity, or roughness. For instance, a higher dimension for a coastline model indicates a more jagged shape; in dynamical systems, strange attractors often have non-integer dimensions that reflect their intricate structure in phase space.
This calculator is designed for a specific, idealized class of fractals. Keep the following assumptions and limitations in mind when interpreting any result:
To deepen your understanding of fractal dimension beyond this simple self-similarity framework, you may want to explore topics such as box-counting dimension, correlation dimension, and multifractals. These approaches extend the idea of dimension to more irregular or statistically self-similar sets, including many real-world data sets and complex dynamical systems.