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.

100% private — runs in your browser

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

  1. Pick a preset, or set the angle and the depth.
  2. Type the size of the trunk square and choose the colours or outlines.
  3. Choose Fitted to one page or Real size.
  4. Check the square count and the drawing size under the preview.
  5. 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

PresetAngleDepthSquaresDrawing size (trunk sides, width × height)Print
Classic 45°, depth 10, brown to green45°102,0475.813 × 3.906fitted
Fine detail: 45°, depth 14 (32,767 squares)45°1432,7675.953 × 3.977fitted
First steps: 45°, depth 3, outlines with triangles45°3154.000 × 3.000fitted
3-4-5 triangle (legs 4 : 3), depth 1136.87°114,0956.214 × 4.248fitted
Golden: child areas in the golden ratio, depth 1138.17°114,0956.190 × 4.224fitted
Leaning: 30°, depth 1130°114,0956.499 × 4.539fitted
Leaning the other way: 60°, depth 1160°114,0956.499 × 4.539fitted
Windswept: 25°, depth 1225°128,1917.224 × 5.258fitted
Blossom tips: 40°, depth 10, pink last level40°102,0476.107 × 4.159fitted
Rainbow levels: 45°, depth 845°85115.625 × 3.813fitted
Black silhouette: 45°, depth 1245°128,1915.906 × 3.953fitted
Colouring sheet: 45° outlines, depth 645°61275.250 × 3.625fitted
Colouring sheet: 3-4-5 outlines with triangles, depth 536.87°5635.126 × 3.726fitted
Real size: 30 mm trunk, 45°, depth 1045°102,0475.813 × 3.906real size, trunk 30 mm
Real size: 1 in trunk, 45°, depth 945°91,0235.750 × 3.875real 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°)

LevelSquaresSide of each (trunk = 1)Total area of the level (trunk = 1)Same as the trunk
011.0000001.000000yes
120.7071071.000000yes
240.5000001.000000yes
380.3535531.000000yes
4160.2500001.000000yes
5320.1767771.000000yes
6640.1250001.000000yes
71280.0883881.000000yes
82560.0625001.000000yes
95120.0441941.000000yes
101,0240.0312501.000000yes
112,0480.0220971.000000yes
124,0960.0156251.000000yes

The count doubles at every level, each side is multiplied by cos 45°, and the total area stays the same.

Angles compared

AngleLeft square sideRight square sideArea split between the twoDrawing size at depth 12 (trunk sides)
45°0.7071070.70710750% : 50%5.906 × 3.953
36.87°0.8000000.60000064% : 36%6.253 × 4.286
38.17°0.7861510.61803461.8% : 38.2%6.229 × 4.243
40°0.7660440.64278858.68% : 41.32%6.206 × 4.208
30°0.8660250.50000075% : 25%6.544 × 4.618
25°0.9063080.42261882.14% : 17.86%7.224 × 5.258
60°0.5000000.86602525% : 75%6.544 × 4.618

Sides are given as a fraction of the parent square.

What prints

DownloadWhat is in it
PDFThe tree fitted to one page or at real size, vector, with the square count and a check bar
PNG 300 DPIThe same sheet as a picture
SVGEvery 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 wantUse
Squares on right triangles, any angle, exact counts and a printPythagoras Tree (this page)
Mandelbrot and Julia sets, or line fractals such as the Koch snowflakeFractal Generator
Squares added at every corner, halving each timeT-Square Fractal
Circular patterns to colourMandala Maker
Plain grid paper for your own drawingsGraph 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.

See all free tools →

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.