Generate a Sierpinski Square
Draw a Sierpinski square fractal. Runs entirely in your browser, so your data never leaves your device.
Output
The result appears here as you type.
How to use Generate a Sierpinski Square
- 1. Set the recursion depth. Choose Depth for how many generations of rotated squares sprout from every corner. A depth-5 pattern produces a dense field of nested, rotated square outlines.
- 2. Size the canvas. Set Width (px) and Height (px) to fit the spreading pattern of nested squares, which grows outward from the original square's corners at each level.
- 3. Pick colors and line width. Choose Line color, Background color and Line width to keep the nested, rotated square outlines distinguishable from one another at higher depths.
- 4. Review the rendered pattern. The tool draws nested rotated square outlines sprouting from every corner as an SVG. Save it once the depth and detail level match what you need.
When to use Generate a Sierpinski Square
Generate a Sierpinski Square draws a fractal of nested, rotated square outlines that sprout recursively from every corner of the previous generation. It is distinct from the Sierpinski carpet's hole-removal approach, instead building outward through rotated squares at each recursive step.
- Comparing outward-growing and inward-removing square fractals. Placing this outward-growing square fractal next to the hole-removing Sierpinski carpet shows two very different recursive strategies that both start from a plain square.
- Teaching rotation in recursive constructions. Since each generation of squares is rotated relative to the last, this fractal is a good example for teaching how a rotation parameter combines with recursion to build complex patterns.
- Designing a spinning, layered decorative pattern. The rotated, nested squares create a pinwheel-like visual texture suited to a design that wants a sense of rotational movement built from purely geometric shapes.
- Producing a fractal figure for a geometry paper. A paper on corner-based recursive square constructions needs a correctly rendered figure at a specific depth to illustrate how the pattern builds outward generation by generation.
Examples
A depth-5 Sierpinski square
Output
An SVG drawing of nested rotated square outlines sprouting from every corner.
About the Generate a Sierpinski Square tool
Generate a Sierpinski Square does its work locally, right in the browser. Draw a Sierpinski square 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 6 settings, including Depth, Width (px), Height (px) and Line color, and the result refreshes the moment you change one. A worked example further down the page shows exactly what the tool produces for a real input.
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 Sierpinski Square 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.