Koch Fractal Generator
The Koch snowflake, created by adding triangular bumps to each side. Customize and download as PNG.
Pick an iteration depth, set a stroke color, and render a Koch snowflake as a downloadable PNG — no need to plot thousands of recursive line segments by hand. The canvas is resizable up to 2000×2000 pixels, so you can grab anything from a quick homework diagram to a print-quality fractal poster. And everything runs in your browser. Nothing gets uploaded.
How It Works
The Koch curve starts as a single straight line. At each iteration, the algorithm takes every line segment, splits it into thirds, and replaces the middle third with two sides of an equilateral triangle. Iteration 0 is a triangle. Iteration 6 looks like a snowflake made of thousands of tiny edges. The browser draws all of it onto an HTML canvas, which you can then save as an image file.
Examples
Quick Math Homework Illustration
A student needs a Koch snowflake diagram for a geometry paper.
Iterations: 3
Color: #000000
Canvas: 600×600
Clean black snowflake, 192 segments, saved as PNG
Generative Art Poster with Custom Colors
An artist wants a high-res Koch fractal in cyan on a dark background for a print.
Iterations: 6
Color: #00e5ff
Canvas: 2000×2000
Detailed cyan snowflake with 12,288 segments — print-ready at 2000px
Teaching Recursion in a CS Lecture
A professor steps through iterations 0 to 5 to show students how recursive subdivision works visually. Each iteration gets screenshotted for the slide deck.
Iterations: 0, then 1, 2, 3, 4, 5
Color: #4338ca
Canvas: 800×800
6 PNGs showing progression: triangle → snowflake (3, 12, 48, 192, 768, 3072 segments)
Who Uses This
Generate Koch snowflake diagrams for homework, papers, and presentations without hand-drawing hundreds of line segments.
Export high-resolution fractal PNGs for posters, album covers, or layered compositions in Photoshop.
Walk through iteration levels live in class to explain recursion, self-similarity, and fractal dimension.
Grab quick fractal graphics for science articles or YouTube thumbnails without needing Processing or Python.
Common Mistakes
Iteration 8+ means over 49,000 segments. Your browser might lag or freeze. Start at 4 or 5, then bump up if your machine handles it fine.
A light gray fractal on a white canvas is basically invisible in the downloaded PNG. Pick a color with strong contrast, or you will wonder why your export looks blank.
At iteration 6 on a 200×200 canvas, the fine details just blur together. Bump the canvas up to at least 800×800 — preferably bigger — so you can actually see the self-similar structure.
Technical Details
- Processing: 100% client-side — Canvas API rendering
- Browser Support: Chrome, Firefox, Safari, Edge
- Max Canvas Size: 2000 × 2000 pixels
- Export Format: PNG
- Iteration Range: 0–10 (higher values may slow rendering)
Frequently Asked Questions
What exactly is a Koch snowflake?
It is a fractal curve built by starting with an equilateral triangle and recursively adding smaller triangles to every side. Each iteration replaces the middle third of each segment with a triangular bump. After a few rounds, the shape looks like a snowflake with infinite perimeter but finite area — one of the classic examples in fractal geometry.
How many iterations should I use?
For most purposes, 4 to 6 iterations is the sweet spot. At 4 you get a clearly recognizable snowflake with 768 segments. At 6 you're at 12,288 segments and the detail is impressive. Going beyond 7 looks nearly identical to the eye but takes noticeably longer to render.
Can I change the background color?
The tool sets the canvas background based on the page theme. If you need a specific background color, download the PNG and add a background layer in any image editor. The exported fractal has a transparent or white background depending on the canvas state.
Is the Koch fractal the same as the Koch curve?
Almost. The Koch curve is a single side — start with one line segment and apply the subdivision rule. The Koch snowflake starts with a triangle (three Koch curves joined together). This tool draws the full snowflake by default, so you get the closed shape rather than just one edge.
Does this tool upload my data anywhere?
No. The fractal is generated entirely in your browser using the HTML Canvas API. Nothing gets sent to a server. Your color choices, iteration settings, and the final image all stay on your device.