Pythagoras Tree
Draw a Pythagoras tree: start with a square, put a right triangle on its top edge, stand a square on each of the two shorter sides, and do the same on every new square. Choose the angle of the triangle (45° gives the classic symmetric tree, other angles make it lean), the depth from 0 to 14 and the size of the trunk square. The tool works out every square from the one below it, so each pair of squares shares its edges exactly with its triangle, and it counts the squares and measures the drawing. Colour by depth, paint the last level in its own colour, show the triangles, or print outlines to colour in. Download a PDF, a 300 DPI PNG or an SVG with every square as an exact polygon. 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 the tree with the trunk square at the side you type when the whole tree fits on one sheet. The SVG holds every square as an exact polygon.
Tree
Page
Runs in your browser with our own code: nothing you type is uploaded or saved. Every square and triangle is worked out from the one before it by our own code. You may use what you make here, including commercially, with no credit needed.
How to draw and print a Pythagoras tree
- Pick a preset, or set the angle and the depth.
- Type the size of the trunk square and choose the colours or outlines.
- Choose Fitted to one page or Real size.
- Check the square count and the drawing size 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: the Pythagorean theorem, powers of 2 and right triangles
- Colouring sheets
- Posters, cards and wall art
- Plotter, laser and vinyl art from the SVG
- Recursion and geometry examples for coding classes
- Checking your own Pythagoras tree drawings
The 15 presets
| Preset | Angle | Depth | Squares | Drawing size (trunk sides, width × height) | |
|---|---|---|---|---|---|
| Classic 45°, depth 10, brown to green | 45° | 10 | 2,047 | 5.813 × 3.906 | fitted |
| Fine detail: 45°, depth 14 (32,767 squares) | 45° | 14 | 32,767 | 5.953 × 3.977 | fitted |
| First steps: 45°, depth 3, outlines with triangles | 45° | 3 | 15 | 4.000 × 3.000 | fitted |
| 3-4-5 triangle (legs 4 : 3), depth 11 | 36.87° | 11 | 4,095 | 6.214 × 4.248 | fitted |
| Golden: child areas in the golden ratio, depth 11 | 38.17° | 11 | 4,095 | 6.190 × 4.224 | fitted |
| Leaning: 30°, depth 11 | 30° | 11 | 4,095 | 6.499 × 4.539 | fitted |
| Leaning the other way: 60°, depth 11 | 60° | 11 | 4,095 | 6.499 × 4.539 | fitted |
| Windswept: 25°, depth 12 | 25° | 12 | 8,191 | 7.224 × 5.258 | fitted |
| Blossom tips: 40°, depth 10, pink last level | 40° | 10 | 2,047 | 6.107 × 4.159 | fitted |
| Rainbow levels: 45°, depth 8 | 45° | 8 | 511 | 5.625 × 3.813 | fitted |
| Black silhouette: 45°, depth 12 | 45° | 12 | 8,191 | 5.906 × 3.953 | fitted |
| Colouring sheet: 45° outlines, depth 6 | 45° | 6 | 127 | 5.250 × 3.625 | fitted |
| Colouring sheet: 3-4-5 outlines with triangles, depth 5 | 36.87° | 5 | 63 | 5.126 × 3.726 | fitted |
| Real size: 30 mm trunk, 45°, depth 10 | 45° | 10 | 2,047 | 5.813 × 3.906 | real size, trunk 30 mm |
| Real size: 1 in trunk, 45°, depth 9 | 45° | 9 | 1,023 | 5.750 × 3.875 | real size, trunk 1 in |
Every count and size is measured by the tool from the squares it draws.
Squares and area at each level (45°)
| Level | Squares | Side of each (trunk = 1) | Total area of the level (trunk = 1) | Same as the trunk |
|---|---|---|---|---|
| 0 | 1 | 1.000000 | 1.000000 | yes |
| 1 | 2 | 0.707107 | 1.000000 | yes |
| 2 | 4 | 0.500000 | 1.000000 | yes |
| 3 | 8 | 0.353553 | 1.000000 | yes |
| 4 | 16 | 0.250000 | 1.000000 | yes |
| 5 | 32 | 0.176777 | 1.000000 | yes |
| 6 | 64 | 0.125000 | 1.000000 | yes |
| 7 | 128 | 0.088388 | 1.000000 | yes |
| 8 | 256 | 0.062500 | 1.000000 | yes |
| 9 | 512 | 0.044194 | 1.000000 | yes |
| 10 | 1,024 | 0.031250 | 1.000000 | yes |
| 11 | 2,048 | 0.022097 | 1.000000 | yes |
| 12 | 4,096 | 0.015625 | 1.000000 | yes |
The count doubles at every level, each side is multiplied by cos 45°, and the total area stays the same.
Angles compared
| Angle | Left square side | Right square side | Area split between the two | Drawing size at depth 12 (trunk sides) |
|---|---|---|---|---|
| 45° | 0.707107 | 0.707107 | 50% : 50% | 5.906 × 3.953 |
| 36.87° | 0.800000 | 0.600000 | 64% : 36% | 6.253 × 4.286 |
| 38.17° | 0.786151 | 0.618034 | 61.8% : 38.2% | 6.229 × 4.243 |
| 40° | 0.766044 | 0.642788 | 58.68% : 41.32% | 6.206 × 4.208 |
| 30° | 0.866025 | 0.500000 | 75% : 25% | 6.544 × 4.618 |
| 25° | 0.906308 | 0.422618 | 82.14% : 17.86% | 7.224 × 5.258 |
| 60° | 0.500000 | 0.866025 | 25% : 75% | 6.544 × 4.618 |
Sides are given as a fraction of the parent square.
What prints
| Download | What is in it |
|---|---|
| The tree fitted to one page or at real size, vector, with the square count and a check bar | |
| PNG 300 DPI | The same sheet as a picture |
| SVG | Every square as an exact polygon at the printed size (and the triangles if shown) |
For a cutter that needs DXF, use SVG to DXF.
Which tool to use
| You want | Use |
|---|---|
| Squares on right triangles, any angle, exact counts and a print | Pythagoras Tree (this page) |
| Mandelbrot and Julia sets, or line fractals such as the Koch snowflake | Fractal Generator |
| Squares added at every corner, halving each time | T-Square Fractal |
| Circular patterns to colour | Mandala Maker |
| Plain grid paper for your own drawings | Graph Paper |
Other tools: the Fractal Generator renders Mandelbrot, Julia and line fractals, the Mandala Maker draws circular patterns and Graph Paper prints 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 a Pythagoras tree?
A flat fractal made of squares. On top of a square sits a right triangle, and on the two shorter sides of the triangle stand two smaller squares; the same step is repeated on every new square. It was invented by the Dutch mathematics teacher Albert E. Bosman in 1942 and is named after Pythagoras, because every three touching squares enclose a right triangle, the picture used for the Pythagorean theorem.
How are the squares worked out?
If a square has side s and the triangle on it has the angle a at its left end, the triangle’s two shorter sides are s × cos a and s × sin a, and those are the sides of the two new squares. The new squares stand on the triangle’s sides, outwards. In our tests every corner matches a separate calculation with complex numbers, and every new square shares its whole base with its triangle.
Why does every level have the same area?
Because of the Pythagorean theorem: the two squares on the shorter sides of a right triangle add up to the square on the longest side (cos² a + sin² a = 1). So the 2 new squares on each square have the same total area as it, and level n, with 2 to the power n squares, has the same total area as the trunk. The table below checks it for levels 0 to 12.
Do the squares overlap?
At 45° they start to overlap at level 5: our test finds no overlapping squares up to level 4 and the first overlap at level 5, which matches the reference description. The tool paints the levels in order, so a later square is drawn over an earlier one where they cross.
How big is the whole tree?
At 45° the whole tree is said to fit in a box 6 trunk sides wide and 4 high. At depth 14 the squares the tool draws span 5.953 × 3.977 trunk sides, inside that box. The drawing size of every preset is in the table below, measured from the squares drawn.
What does the angle do?
At 45° both new squares are the same size and the tree is symmetric. Smaller angles make the left square bigger and the tree lean to the right; 90° minus the angle gives the mirror image. At about 36.87° the triangle is a 3-4-5 triangle, so the new squares are exactly 0.8 and 0.6 of their parent; at about 38.17° their areas are in the golden ratio.
Why does it stop at depth 14?
Depth 14 already has 32,767 squares, and at 45° the smallest are 1/128 of the trunk side: on a 40 mm trunk that is about 0.31 mm, close to what a printer can show.
Can it print at real size?
Yes, when the whole tree fits on one sheet: the trunk square is then printed at the side you type, and every square is within 0.2 mm of its true place in our tests on US Letter and A4, as long as you print at 100% (Actual size). Bigger trees print fitted to the page.
Is it free?
Yes. There is no sign-up, no watermark and no limit.
Is anything uploaded?
No. Every square and number is worked out by JavaScript in your browser. Nothing you type is sent anywhere or saved when you close the page.