Draw a Koch Fractal screenshot

Draw a Koch Fractal

Draw a Koch snowflake or single Koch curve: each segment splits into four, with the middle third pushed out at 60 degrees.

Privacy First
0 Runs
Updated 2026-11-06
No upload
Runs in this tab

One rule, four segments

The Koch rule replaces every straight segment with four: the middle third is replaced by the two other sides of an equilateral triangle built on it. The page rotates that bump 60 degrees outward from each segment, so the outline grows away from the interior instead of folding into it. A snowflake is three of these curves joined around an equilateral triangle; the single-curve mode is one side.

The count follows the rule exactly: 4^n segments per curve, so the snowflake holds three times that. Depth is capped at six, which is 12,288 strokes for the snowflake. Every stroke goes into one canvas path, so the cost is strokes rather than DOM nodes, but one more level is 49,152 strokes and the tab visibly stalls.

Choose snowflake or single curve and a depth; the drawing is a pure function of those two choices. Nothing is fetched, stored or uploaded.

Draw the Koch curve or the Koch snowflake: every segment is replaced by four, with the bump rotated 60° outward.

The outline grows away from the interior, so the snowflake's boundary lengthens at every depth while its area stays bounded — and nothing is uploaded.

How to use it

Choose the snowflake (three curves) or a single curve, set the depth, then press Draw or Animate. Stop ends the animation, and the status line names the stroke count at that depth.

The rule

Each step replaces one segment with four, so the count multiplies by four per level. The middle bump is turned 60° outward from every segment, which is why the outline grows away from the interior rather than into it.

Where it stops

Depth is capped at 6, where three sides are already 12,288 strokes. There is no export and no colour control, and the figure is drawn rather than measured.

What to Expect

Best for

  • seeing a bounded area with an unbounded boundary
  • producing a snowflake figure at a chosen detail

What this tool keeps

  • The substitution and the drawing run in this tab; the page uploads nothing and keeps no image.

Frequently asked questions

What is the difference between the two shapes?

Snowflake draws three Koch curves joined into a closed boundary; single curve draws one. The substitution rule is the same, so the stroke count triples with the snowflake.

Why is the depth capped at 6?

Because each step replaces one segment with four, so depth 6 is already 12,288 strokes on three sides — beyond what this canvas separates.

Is the figure measured anywhere?

No. The page draws the curve; it does not report its length, its area or its dimension. Those are different pages in the fractal family.

Developer program

Build custom tools for your store

Join the SDK program to create useful ecommerce utilities for your store.