By · Updated

Koch Snowflake Generator

Adjustable Depth, Nested Layers, Anti-Snowflake, Outline or Fill, Exported as PNG

No ratings yet

Loading…

OneTask is free, with no sign-up, and built by one person.
If this tool saved you time, a coffee helps keep new ones coming.

How the Koch Snowflake Generator works

This Koch snowflake generator draws the fractal step by step. The Koch snowflake starts as a triangle and grows a smaller triangle on the middle third of every edge, again and again. Set how many times, stack nested copies inside each other for a snowflake-within-a-snowflake, flip it to the anti-snowflake where the bumps point inward, and save the result as a PNG at wallpaper size.

Koch snowflake generator: getting a good result

Helge von Koch published the curve in 1904 as an example of a line that is continuous everywhere but has a tangent nowhere. The rule is simple: divide each straight segment into three, replace the middle third with the two sides of an equilateral triangle pointing outward, and repeat on every segment that results. Each pass multiplies the segment count by four and the perimeter by four-thirds.

Depth is the number of passes. Depth 0 is the plain triangle, depth 1 the six-pointed star, depth 4 the familiar snowflake with 768 edges, and depth 7 has 49,152 edges, most of them shorter than a pixel at preview size but visible on a 4K export. The perimeter at depth 7 is about 13 times the original triangle's, and it grows without limit, while the area converges to eight-fifths of the starting triangle: infinite edge around a finite region.

Anti-snowflake points the new triangles inward instead of outward. The same rule, the opposite sign, gives a shape that looks like a triangle eaten by frost rather than one growing crystals.

Nested layers draws smaller copies inside the first, each scaled down and one depth level lower than the one outside it, so the innermost is the simplest. With Filled on and Rainbow colour, the layers stack as bands of tint that make a flat snowflake read as a cross-section.

Fill and weight. Outline draws the curve as a line of the chosen weight; Filled paints the interior. At depth 6 and above the outline is so busy that Filled usually looks cleaner. Colour picks the hue from the seed, so Regenerate changes only the colour; the geometry is deterministic.

Export. The shape is regenerated at the export size and fitted to the canvas, so a 4K export of depth 7 shows edges the preview cannot.

FAQ

What is the fractal dimension of the Koch curve?

log 4 / log 3, about 1.262: every scaling by a third gives four copies instead of the three a straight line would give, so it is more than a line and less than a surface.

Why does the perimeter go to infinity but the area does not?

Each pass adds triangles whose total area shrinks by a factor of four-ninths while the perimeter grows by four-thirds. A geometric series with ratio below one sums to a finite number; one with ratio above one does not.

Is it an L-system?

Yes: axiom F−−F−−F, rule F → F+F−−F+F, turning 60°. The L-system tree generator on this site handles the bracketed plant kind; this page draws the snowflake directly, which is faster.

Why do the segments disappear at high depth?

At depth 7 each segment is the side length divided by 3⁷, about 2,187 times smaller. On a 700-pixel preview that is under a pixel. Export at 4K to see them.

See also: all Generative Art tools, Images, Audio, Video & Screen, PDF, SVG, Simulations & Screensavers, Chart Makers, 3D Model Viewers, Drawing Pads, Mockups & 3D Making, Diagram Makers, 3D Science, Tracker Music.

Related tools