Generate a Generalized Cantor Set
Draw a generalized Cantor set. 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 Generalized Cantor Set
- 1. Set the levels and kept fraction. Use Levels for how many times the removal repeats, and Kept fraction for how much of each interval's end is retained. A fraction near a third reproduces the classic middle-thirds Cantor set.
- 2. Size the canvas. Set Width (px), Height (px) and Bar height so each level's row of segments is clearly visible, especially at higher level counts where segments get very thin.
- 3. Choose colors and line width. Pick Line color, Background color and Line width to match the rest of your material, whether that is a lecture slide or a printed handout.
- 4. Review the rendered set. The SVG shows the fraction you specified kept at each end of every interval, level by level. Save it once the removal pattern matches what you intended to illustrate.
When to use Generate a Generalized Cantor Set
Generate a Generalized Cantor Set extends the classic middle-thirds construction with an adjustable Kept fraction, so you can remove any middle proportion instead of exactly a third. It is for exploring the whole family of Cantor-like sets rather than just the original.
- Teaching how the removal fraction affects dimension. The Hausdorff dimension of the resulting set depends directly on the kept fraction. Varying the slider and recomputing the dimension is a hands-on way to connect the formula to a picture.
- Building a fractal geometry problem set. Ask students to predict what the set will look like for a kept fraction of 0.2 versus 0.4, then render both to check their intuition against the actual construction.
- Comparing against the plain Cantor set. Set the kept fraction near one third to reproduce the standard Cantor set, then adjust it to see how the picture changes as more or less is retained.
- Researching measure-theoretic examples. A paper discussing sets of varying Hausdorff dimension needs an illustrative figure generated at a specific, citable kept fraction and level count.
Examples
A 6-level generalized Cantor set
Output
An SVG drawing of the Cantor set keeping a fraction r at each end of every interval.
About the Generate a Generalized Cantor Set tool
Generate a Generalized Cantor Set does its work locally, right in the browser. Draw a generalized Cantor set. 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 Levels, Kept fraction, Width (px) and Height (px), 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 Generalized Cantor Set 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.