EditSafely

Generate a Pythagoras Tree Fractal

Draw a Pythagoras tree fractal. Runs entirely in your browser, so your data never leaves your device.

Output

The result appears here as you type.

Options

How to use Generate a Pythagoras Tree Fractal

  1. 1. Set the depth and branch angle. Choose Depth for how many generations of squares branch off, and Angle for how sharply each pair of child squares splits. 45 degrees produces the classic symmetric tree shape.
  2. 2. Size the canvas. Set Width (px) and Height (px) to fit the tree's spreading canopy. Deeper trees or wider angles need more horizontal room as the branching squares spread outward.
  3. 3. Pick colors and line width. Choose Line color, Background color and Line width to make individual squares distinguishable, especially near the trunk where the largest squares sit.
  4. 4. Review the rendered tree. The tool draws the classic Pythagoras tree of squares as an SVG, branching from a base square into progressively smaller pairs. Save it once the depth and angle look right.

When to use Generate a Pythagoras Tree Fractal

Generate a Pythagoras Tree Fractal draws squares that sprout right-triangle pairs of smaller squares, repeating recursively, a construction directly linked to the Pythagorean theorem. It is one of the more recognizably tree-like fractals, since its branching pattern resembles natural growth.

  • Connecting the Pythagorean theorem to fractals. Each branching step in the tree relies on the Pythagorean theorem to size the child squares, making it a natural follow-up example after teaching the theorem itself.
  • Exploring how branch angle changes tree shape. Adjusting the Angle away from 45 degrees produces a lopsided, asymmetric tree instead of the classic symmetric one, a good way to show how one parameter reshapes the whole fractal.
  • Producing a nature-inspired generative art piece. The Pythagoras tree's branching squares resemble a stylized tree canopy, making it a popular choice for generative art or a mathematically grounded illustration of natural branching.
  • Illustrating recursive area or perimeter growth. A lecture on recursive sequences can use the Pythagoras tree to show how total area converges even as the number of squares grows without bound at each depth.

Examples

A depth-8 Pythagoras tree

Output

An SVG drawing of the classic 45° Pythagoras tree of squares.

A leaning tree at 30°

Output

An SVG drawing of an asymmetric Pythagoras tree.

About the Generate a Pythagoras Tree Fractal tool

Generate a Pythagoras Tree Fractal does its work locally, right in the browser. Draw a Pythagoras tree fractal. There is no upload step, no queue and no account, and your data never travels over the network.

It belongs to the Math Tools collection on EditSafely, a set of 234 small, focused Math utilities that share the same instant, private workspace.

You can shape the output with 7 settings, including Depth, Angle, Width (px) and Height (px), and the result refreshes the moment you change one. 2 worked examples further down the page show exactly what the tool produces for real inputs.

Running locally also makes the tool fast and dependable: results appear as you type or drop a file, there is no server outage that can take it down mid-task, and confidential data can be processed without a second thought.

Frequently asked questions

Does Generate a Pythagoras Tree Fractal cost anything?

Yes, it is completely free. All 2,658 tools on EditSafely work without an account, a subscription or usage limits.

Does the generator send anything to a server?

No data leaves your device. The whole tool is JavaScript that runs inside your browser tab, so there is no upload, no server-side processing and no log of what you did. If you disconnect from the internet after the page loads, it keeps working.

How do I get a different result?

Run the generator again. Each run is computed fresh on your device, and any options you change are applied to the next result immediately.

Do I need to sign up or install anything?

Nothing to install and no account needed. Open the page in any up-to-date browser, including on a phone or tablet, and the tool is ready.

Can I save what the tool produces?

Yes. Use the download or copy controls in the output panel to keep the rendered result once it looks the way you want.

Related tools

All Math Tools