Hausdorff Fractal Generator
Draw fractals with Hausdorff dimension info — Koch curve, Sierpinski triangle, Cantor set, and more
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
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.
Fractal: Koch Curve
Iterations: 5
Line Color: #2563eb
Background: #ffffff
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.
Fractal: Sierpinski Carpet
Iterations: 4
Line Color: #f59e0b
Background: #0f172a
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.
Fractal: Cantor Set
Iterations: 7
Line Color: #dc2626
Background: #fefce8
Red bars shrinking toward dust
Hausdorff dim: ≈ 0.6309
Formula: log(2)/log(3)
Who Uses This
Generate fractals for homework, thesis illustrations, or study aids on dimension theory.
Create live demos of self-similarity and fractal dimension during lectures.
Grab geometric patterns for posters, album art, or website backgrounds.
Quick reference for recursive algorithm behavior before implementing their own version.
Common Mistakes
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.
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.
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
- Processing: 100% client-side — Canvas API, no server calls
- Browser Support: Chrome, Firefox, Safari, Edge
- Available Fractals: Koch Curve, Sierpinski Triangle, Cantor Set, Sierpinski Carpet, Vicsek Fractal
- Export Format: PNG at canvas resolution
- Max Iterations: 10 (higher values auto-capped to prevent browser freeze)
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.