Sierpinski Triangle Generator
Draw a Sierpinski triangle to a chosen order, with the triangle count 3^order stated and the subdivision rule shown on the page.
What this page draws
Replaces every filled triangle with the three half-size triangles at its corners, repeated to the order you choose, and states the resulting triangle count.
How to use it
Choose an order from 0 to 9 and press Draw. Order 0 is the single starting triangle; each step triples the count. The facts show the count the picture actually contains.
Worked example: order 4 becomes 81 triangles, each one quarter the area of the starting triangle.
What the picture states
Domain: The unit triangle, drawn to fit the canvas.
Sampling: Exactly 3^order triangles; order 4 is 81 and order 9 is 19,683.
The caption under the picture repeats both, so the drawing and the facts cannot disagree.
How it works
Order 0 is one triangle. Each further order replaces each triangle with three, so the count is 3^order and the side of every triangle is halved at each step. The drawing is the exact set of those triangles.
What it refuses
An order outside 0 to 9 is refused by name, because order 9 is 19,683 triangles and the cap keeps both the drawing and the browser responsive.
Where it runs
The picture is computed and drawn in this tab: there is no upload, no network request, no plotting library and no model, so nothing you paste leaves your device.
Replaces every filled triangle with the three half-size triangles at its corners, repeated to the order you choose, and states the resulting triangle count.
Order 0 is one triangle. Each further order replaces each triangle with three, so the count is 3^order and the side of every triangle is halved at each step. The drawing is the exact set of those triangles. The picture is computed and drawn in this tab: there is no upload, no network request, no plotting library and no model, so nothing you paste leaves your device.
Domain: The unit triangle, drawn to fit the canvas. Sampling: Exactly 3^order triangles; order 4 is 81 and order 9 is 19,683.
Worked example: order 4 becomes 81 triangles, each one quarter the area of the starting triangle.
How to use the sierpinski triangle generator
Choose an order from 0 to 9 and press Draw. Order 0 is the single starting triangle; each step triples the count. The facts show the count the picture actually contains.
The picture is computed and drawn in this tab: there is no upload, no network request, no plotting library and no model, so nothing you paste leaves your device.
- Order (0 to 9) — a number from 0 to 9
What the picture states
Replaces every filled triangle with the three half-size triangles at its corners, repeated to the order you choose, and states the resulting triangle count.
Order 0 is one triangle. Each further order replaces each triangle with three, so the count is 3^order and the side of every triangle is halved at each step. The drawing is the exact set of those triangles.
- Domain: The unit triangle, drawn to fit the canvas.
- Sampling: Exactly 3^order triangles; order 4 is 81 and order 9 is 19,683.
- The caption under the picture repeats the domain and the sample count, so the drawing and the facts cannot disagree.
What it refuses, and what it leaves out
An order outside 0 to 9 is refused by name, because order 9 is 19,683 triangles and the cap keeps both the drawing and the browser responsive.
- Not the right page for: area and perimeter formulas, which the Draw a Sierpinski Fractal page computes
- Not the right page for: orders above 9, which are refused
What to Expect
Best for
- seeing a fractal construction exactly
- a geometry lesson on self-similarity
- a poster or wallpaper
Not ideal for
- area and perimeter formulas, which the Draw a Sierpinski Fractal page computes
- orders above 9, which are refused
What this tool keeps
- The exact triangle set for the order
- The 3^order count
- The halving rule
What may need cleanup
- Choosing an order the eye can resolve
- Downloading SVG when you need to scale the print
Common errors
- An order of 9 is 19,683 polygons and takes a moment
- A fractional order is floored
Example use cases
- A self-similarity demo
- A geometry poster
- A recursion exercise
Sample input
order 4
Sample output
81 triangles, each one quarter the area of the starting triangle
Who this is for
- Students
- Teachers
- Designers
Frequently asked questions
Is my data sent anywhere?
The picture is computed and drawn in this tab: there is no upload, no network request, no plotting library and no model, so nothing you paste leaves your device.
What can I download?
Two files from the same drawing: a PNG captured from the canvas and an SVG built from the same drawing operations. Both are produced in your browser, and neither is uploaded.
Why does the page state the domain and the sample count?
Because a picture is a finite sample of a mathematical object. Saying where it was sampled and how many points were used is the difference between a plot and a guess. The unit triangle, drawn to fit the canvas. Exactly 3^order triangles; order 4 is 81 and order 9 is 19,683.
How many triangles will I get?
3 to the power of the order. Order 4 is 81, order 6 is 729, order 9 is 19,683. The facts on the page repeat the number the picture contains.
Is this the same as the Draw a Sierpinski Fractal page?
That page computes the triangle count, area and perimeter and prints them as numbers. This one draws the triangles themselves, so the two answer different questions.
Build custom tools for your store
Join the SDK program to create useful ecommerce utilities for your store.