EditSafely

Generate a Sierpinski Curve

Draw a Sierpinski closed plane 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 Sierpinski Curve

  1. 1. Set the iteration count. Choose Iterations for how finely the closed loop fills its region. A 3-iteration Sierpinski curve already covers its plane region densely while forming a single closed path.
  2. 2. Size the canvas. Set Width (px) and Height (px) to fit the closed loop's fill pattern, keeping the canvas square to match the curve's symmetric coverage.
  3. 3. Pick colors and line width. Choose Line color, Background color and Line width depending on whether you want the individual loop windings visible or a smoother overall filled appearance.
  4. 4. Review the rendered curve. The tool draws the closed Sierpinski space-filling curve as an SVG, a single loop that covers a plane region without lifting the pen. Save it once the fill density looks right.

When to use Generate a Sierpinski Curve

Generate a Sierpinski Curve draws a closed, self-similar space-filling curve related to the Sierpinski triangle family, distinct from both the filled carpet and the open arrowhead curve. It is for exploring closed-loop space-filling constructions beyond the more commonly taught Hilbert and Moore curves.

  • Expanding beyond Hilbert-family space-filling curves. Most space-filling curve coursework focuses on Hilbert and Peano curves built on square grids. This curve shows the same closed-loop filling idea applied to a triangular subdivision instead.
  • Comparing closed and open Sierpinski constructions. Render this closed curve next to the open Sierpinski arrowhead curve to show students the difference between a space-filling loop and a boundary-tracing path within the same fractal family.
  • Producing an unusual generative art texture. The dense, triangular fill pattern of this curve gives a different visual texture from square-grid space-filling curves, useful as a distinctive background layer in generative art.
  • Illustrating advanced fractal curve topics in a paper. A paper surveying the range of space-filling curve constructions can include this less common triangular variant alongside the standard Hilbert and Peano examples.

Examples

A 3-iteration Sierpinski curve

Output

An SVG drawing of the closed Sierpinski space-filling curve.

About the Generate a Sierpinski Curve tool

Generate a Sierpinski Curve runs as plain JavaScript in your browser tab, with no server behind it. Draw a Sierpinski closed plane fractal. Whatever you put in stays on your device from start to finish.

The tool is part of EditSafely's Math Tools section, 234 single-purpose utilities built around the same idea: open the page, get the result, keep your data to yourself.

You can shape the output with 6 settings, including Iterations, 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.

That local-first design has practical benefits beyond privacy. The tool keeps working on a flaky connection once the page has loaded, results are instant because nothing round-trips to a server, and it is safe to use with confidential material.

Frequently asked questions

Does Generate a Sierpinski Curve 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