Sierpinski Triangle
Draw the Sierpinski triangle at any level from 0 to 9: start with one triangle, take out the middle one, and repeat on every triangle that is left. The tool counts the triangles and the area that is left, colours them by corner, and prints a colouring sheet, a cut-out template, a poster at real size over several sheets, or every level side by side. It also makes the same shape two other ways, with the chaos game (random points) and with the odd numbers of Pascal’s triangle, and draws the square version, the Sierpinski carpet. Download a PDF, a 300 DPI PNG or an SVG. Nothing is uploaded.
100% private — everything runs in your browser. Everything runs in your browser; nothing is uploaded.
Print at 100% (Actual size). Real size prints across as many sheets as it needs: cut each sheet on its dashed line and butt the edges together, matching the corner marks. The SVG holds the drawing at real size.
Drawing
Colours
Page
Runs in your browser with our own code: nothing you type is uploaded or saved. Every triangle, square, point and number is generated and counted by our own code. You may use what you make here, including commercially, with no credit needed.
How to make and print a Sierpinski triangle
- Pick a preset, or choose what to draw: the filled triangle, outlines, the cut-out template, levels side by side, the chaos game, Pascal’s triangle or the carpet.
- Set the level (or the number of points for the chaos game) and the colours.
- Type the side length and choose Fitted to one page or Real size (tiled over sheets if it is bigger than the paper).
- Check the counts under the preview.
- Download the PDF and print at 100% (Actual size), or the PNG or SVG.
What you can use it for
- Maths lessons: self-similarity, powers of 3 and limits
- Colouring sheets and classroom displays
- Cut-paper and stencil projects from the cut-out template
- Posters and wall art at real size
- Pascal’s triangle and odd and even numbers
- Pen plotter, laser and vinyl art from the SVG
The 16 presets
| Preset | Level | What is drawn | Side | |
|---|---|---|---|---|
| Classic triangle, level 5 (243 triangles) | 5 | 243 triangles | 180 mm | fitted |
| Three corners in three colours, level 6 | 6 | 729 triangles | 180 mm | fitted |
| Colour by address sum, level 4 | 4 | 81 triangles | 180 mm | fitted |
| Fine detail, level 8 (6,561 triangles) | 8 | 6,561 triangles | 180 mm | fitted |
| Level 9 (19,683 triangles) | 9 | 19,683 triangles | 180 mm | fitted |
| Colouring sheet: level 4 outlines | 4 | 81 triangles | 180 mm | fitted |
| Cut-out template, level 3 (13 holes) | 3 | 13 holes to cut | 150 mm | fitted |
| Levels 0 to 5 side by side | 5 | levels 0–5 | 180 mm | fitted |
| Chaos game: 10,000 points | – | 10,000 points | 180 mm | fitted |
| Chaos game: 30,000 points coloured by corner | – | 30,000 points | 180 mm | fitted |
| Pascal’s triangle mod 2: 16 rows with the numbers | 4 | 16 rows, 81 odd | 180 mm | fitted |
| Pascal’s triangle mod 2: 64 rows | 6 | 64 rows, 729 odd | 180 mm | fitted |
| Sierpinski carpet, level 3 (512 squares) | 3 | 512 squares | 180 mm | fitted |
| Sierpinski carpet, level 5, corner and edge colours | 5 | 32,768 squares | 180 mm | fitted |
| Poster: 600 mm triangle, level 6, real size on tiled sheets | 6 | 729 triangles | 600 mm | real size, 12 sheets (Letter) |
| Card-size triangle: 4 in, level 4, real size | 4 | 81 triangles | 0.16 in | real size, 1 sheet (Letter) |
Every count is worked out by the tool from the shapes it draws.
Triangles, area and holes at each level
| Level | Triangles | Area left | Triangles cut out | Count checked |
|---|---|---|---|---|
| 0 | 1 | 100% | 0 | yes |
| 1 | 3 | 75% | 1 | yes |
| 2 | 9 | 56.25% | 4 | yes |
| 3 | 27 | 42.1875% | 13 | yes |
| 4 | 81 | 31.6406% | 40 | yes |
| 5 | 243 | 23.7305% | 121 | yes |
| 6 | 729 | 17.7979% | 364 | yes |
| 7 | 2,187 | 13.3484% | 1,093 | yes |
| 8 | 6,561 | 10.0113% | 3,280 | yes |
| 9 | 19,683 | 7.5085% | 9,841 | yes |
Each level keeps 3 of the 4 half-size triangles, so the count triples and the area left is multiplied by 3/4.
Pascal’s triangle mod 2
| Rows | Numbers | Odd numbers (filled) | Same cells as the Sierpinski triangle |
|---|---|---|---|
| 2 | 3 | 3 | yes |
| 4 | 10 | 9 | yes |
| 8 | 36 | 27 | yes |
| 16 | 136 | 81 | yes |
| 32 | 528 | 243 | yes |
| 64 | 2,080 | 729 | yes |
The tool fills the odd numbers and compares them cell by cell with the triangles of the same level.
The Sierpinski carpet
| Level | Squares | Area left | Squares taken out |
|---|---|---|---|
| 0 | 1 | 100% | 0 |
| 1 | 8 | 88.8889% | 1 |
| 2 | 64 | 79.0123% | 17 |
| 3 | 512 | 70.2332% | 217 |
| 4 | 4,096 | 62.4295% | 2,465 |
| 5 | 32,768 | 55.4929% | 26,281 |
Each level keeps 8 of the 9 third-size squares.
What prints
| Download | What is in it |
|---|---|
| The drawing fitted to one page or at real size on tiled sheets, vector, with the counts and a check bar on every sheet | |
| PNG 300 DPI | The same sheets as pictures (a ZIP when there is more than one) |
| SVG | The drawing at real size, one path per colour |
For a cutter that needs DXF, use SVG to DXF.
Which tool to use
| You want | Use |
|---|---|
| The Sierpinski triangle or carpet, the chaos game or Pascal’s triangle mod 2, with counts and a print | Sierpinski Triangle (this page) |
| Mandelbrot and Julia sets, or line fractals such as the Koch snowflake and the Sierpinski arrowhead curve | Fractal Generator |
| A cube sponge made of smaller cubes | Menger Sponge |
| Repeating tile patterns | Truchet Tiles |
| Triangle-grid paper for your own drawings | Isometric Graph Paper |
Other tools: the Fractal Generator renders Mandelbrot, Julia and line fractals, Truchet Tiles makes tile patterns and Isometric Graph Paper prints triangle grids.
More free tools
Geometry, patterns and printables?
Drawing and print tools that run privately in your browser, with no sign-up and no watermark.
Frequently asked questions
What is the Sierpinski triangle?
A shape made by starting with a triangle, joining the midpoints of its sides and taking out the middle triangle, then doing the same to each of the three triangles that are left, again and again. Each round is a level. It is named after Wacław Sierpiński, who described it in 1915.
How many triangles are there at each level?
At level n there are 3 to the power n triangles, each half the size of those at the level before, and together they cover (3/4) to the power n of the first triangle. The table below gives every level from 0 to 9; our tests count the triangles the tool draws and add up their areas exactly.
What is the chaos game?
Start at any point, pick one of the three corners at random and move half way towards it, then repeat. After a few moves every point lands on the Sierpinski triangle. The tool starts at the centre, does 20 moves before it draws anything, and uses a seed so the same seed always gives the same picture. Our tests check that every drawn point lies inside the level-6 triangles.
How is it related to Pascal’s triangle?
Write out Pascal’s triangle with 2, 4, 8, 16, 32 or 64 rows and fill in the odd numbers: the filled cells are exactly the Sierpinski triangle of that level. Our tests check this for every cell up to 64 rows.
What is the Sierpinski carpet?
The square version: cut a square into 9, take out the middle one and repeat on the 8 that are left. Level n has 8 to the power n squares covering (8/9) to the power n of the square. Sierpiński described it in 1916.
What is its fractal dimension?
The Sierpinski triangle is made of 3 copies of itself at half the size, so its dimension is log 3 / log 2, about 1.585. The carpet is 8 copies at a third of the size: log 8 / log 3, about 1.893.
How is this different from the Sierpinski arrowhead on the Fractal Generator?
The arrowhead there is a single wiggly line (an L-system curve) that fills in the same outline as it gets longer. This page draws the triangle itself, the filled triangles that are left after cutting out the middles, and counts them.
How do I use the cut-out template?
Print it, then cut out every dashed triangle. What is left is the level you chose. Level 3 has 13 triangles to cut out; level n has (3 to the power n − 1) / 2.
How does the real-size print work when the drawing is bigger than the paper?
Choose Real size. The tool splits the drawing over as many sheets as it needs, each with a dashed edge, corner marks and a label such as A1 (row A, column 1). Cut each sheet on its dashed line, butt the edges together in order and tape them. Every printed corner is at its true position to within 0.2 mm in our tests, on US Letter and A4, as long as you print at 100% (Actual size); the check bar on each sheet lets you confirm the scale.
Is it free?
Yes. There is no sign-up, no watermark and no limit.
Is anything uploaded?
No. Every shape and number is worked out by JavaScript in your browser. Nothing you type is sent anywhere or saved when you close the page.