Tools

Home
Password GeneratorLorem IpsumCoin FlipperRandom StringToken GeneratorRandom Color

Hausdorff Fractal Generator

Draw fractals with Hausdorff dimension info — Koch curve, Sierpinski triangle, Cantor set, and more

Your files never leave your browser
Ready·Canvas API rendering

Pick a fractal type — Koch Curve, Sierpinski Triangle, Cantor Set, Sierpinski Carpet, or Vicsek — adjust the iteration depth and colors, then hit Draw. The generator renders the shape on canvas and shows its exact Hausdorff dimension, ready to download as PNG.

And everything runs in your browser. Nothing gets uploaded.

How It Works

Pick Fractal & Settings
→
Recursive Canvas Rendering
→
Fractal + Dimension Output

Each fractal type has a specific recursive algorithm. The Koch Curve, for instance, replaces every straight line segment with four smaller segments at each iteration — that’s why its Hausdorff dimension is log(4)/log(3) ≈ 1.2619. The tool applies the recursion for however many iterations you choose, draws the geometry onto an HTML canvas element, then computes the theoretical dimension using the fractal’s self-similarity ratio.

Examples

Koch Snowflake for a Math Presentation

You need a clean Koch Curve visual for a slide deck on fractal geometry.

INPUT
Fractal: Koch Curve Iterations: 5 Line Color: #2563eb Background: #ffffff
OUTPUT
Detailed Koch Curve PNG Hausdorff dim: ≈ 1.2619 Formula: log(4)/log(3)

Sierpinski Carpet as a Poster Background

A designer wants a geometric pattern with a dark aesthetic for print work.

INPUT
Fractal: Sierpinski Carpet Iterations: 4 Line Color: #f59e0b Background: #0f172a
OUTPUT
Gold-on-navy carpet fractal Hausdorff dim: ≈ 1.8928 Formula: log(8)/log(3)

Cantor Set for Teaching Measure Theory

A professor wants to show students how the Cantor Set "disappears" — a set with zero length but uncountably many points. Higher iterations make the visual effect obvious.

INPUT
Fractal: Cantor Set Iterations: 7 Line Color: #dc2626 Background: #fefce8
OUTPUT
Red bars shrinking toward dust Hausdorff dim: ≈ 0.6309 Formula: log(2)/log(3)

Who Uses This

🎓 Math Students

Generate fractals for homework, thesis illustrations, or study aids on dimension theory.

👩‍🏫 Educators

Create live demos of self-similarity and fractal dimension during lectures.

🎨 Designers

Grab geometric patterns for posters, album art, or website backgrounds.

💻 Developers

Quick reference for recursive algorithm behavior before implementing their own version.

Common Mistakes

Cranking iterations too high

At 8+ iterations on the Koch Curve, details become sub-pixel and the shape looks like a solid blob. Stick to 4–6 for curves, 3–5 for carpets. The Cantor Set handles higher counts better — 7 or 8 still looks clear.

Picking line and background colors that are too close

Light gray on white, dark blue on black — the fractal renders fine but you can barely see it. Use high-contrast combinations. The download PNG will look exactly like what’s on screen, so check before saving.

Confusing Hausdorff dimension with iteration count

The dimension number (like 1.2619 for Koch) is a fixed mathematical property of that fractal. It does not change when you add more iterations. Iterations affect visual detail; the dimension describes the fractal’s inherent complexity.

Technical Details

Frequently Asked Questions

What is the Hausdorff dimension of a fractal?

It measures how "rough" or space-filling a fractal is. Regular shapes have integer dimensions — a line is 1, a square is 2. Fractals land somewhere in between. The Koch Curve sits at about 1.26, meaning it’s more complex than a simple line but doesn’t fill a plane.

How many iterations should I use?

For Koch Curve and Sierpinski Triangle, 4 to 6 gives you good detail without turning into mush. The Cantor Set can go up to 7 or 8 and still look distinct. Sierpinski Carpet gets heavy fast — 4 is usually enough. Going above 8 on most fractals won’t add visible detail and may slow your browser.

Why does my fractal look like a solid shape?

Too many iterations. When the recursive detail shrinks below one pixel, the browser fills everything in and you lose the fractal pattern. Lower your iteration count by 1 or 2 and it should look right again.

Can I use the generated fractal image commercially?

Yes. The PNG you download is generated entirely by your browser. There’s no copyright on a mathematical shape rendered by code you ran locally. Use it in presentations, prints, merchandise — whatever you need.

Does this tool upload my data anywhere?

No. The entire fractal rendering happens in your browser’s Canvas API. Nothing gets sent to a server. You could disconnect from the internet after loading the page and it would still work perfectly.

Share: