Simplify Your Workflow: Search MiniWebtool.
Add Extension
Home Page > Miscellaneous > General Tools > Sierpinski Triangle Generator

Sierpinski Triangle Generator

Generate the Sierpinski triangle fractal at any depth using deterministic recursive subdivision or the chaos-game random-walk method. Compare both algorithms side by side, color triangles by recursion depth, see live area and self-similarity stats, and export a crisp SVG or PNG.

Sierpinski Triangle Generator
Try a preset:
Recursive subdivision deterministically removes the central sub-triangle at each level — visualizes the fractal directly. Chaos game drops dots from random midpoint jumps — the fractal emerges from randomness. Both draws them side by side so you can compare.
Depth N produces 3N small triangles. Depth 5 → 243, depth 7 → 2,187, depth 9 → 19,683.
More iterations = denser dot cloud. 5,000 is plenty for a clear fractal; 10,000+ for crisp print.
Pure server-side recursion + chaos game · no libraries · animated drawing on render.

Embed Sierpinski Triangle Generator Widget

About Sierpinski Triangle Generator

The Sierpinski Triangle Generator draws the most famous fractal in computer science and recreational mathematics — at any depth, from any outer triangle, using either the deterministic recursive subdivision algorithm or the surprising chaos game random walk. Side-by-side mode draws both at once so you can see that randomness and recursion converge to exactly the same shape. The tool reports the leaf count, the precise remaining area, and the Hausdorff dimension (log 3 / log 2 ≈ 1.5849625), and exports a clean SVG suitable for slides, worksheets, or laser-cutting.

How the Sierpinski Triangle Is Built — Step by Step

Depth 0: Start with a single triangle. The fractal at this depth is just the whole triangle — your starting canvas.

Depth 1: Find the midpoint of each side. Connect them — this defines a central (inverted) sub-triangle. Remove that center; keep the three corner sub-triangles. You now have 3 triangles, each ½ the side length and ¼ the area of the original.

Depth 2: Apply the same rule to each of the 3 surviving triangles. You now have 9 triangles, each ¼ the side and 1/16 the area of the original.

Depth N: Keep applying the rule. After N steps you have 3N tiny triangles, each (1/2)N the side length and (1/4)N the area of the original. The pattern repeats at every scale — that's the self-similarity that gives the Sierpinski triangle its fractal character.

What Makes This Sierpinski Generator Different

Two algorithms in one Most online generators only show the recursive subdivision. This one also offers the chaos game and a side-by-side mode that proves the two completely different processes converge to the same fractal — a powerful teaching moment.
Four outer-triangle shapes Equilateral, right triangle, tall isoceles, and wide Pascal-style layout. The Sierpinski recursion works on any triangle — preserving self-similarity under any affine map — and showing all four makes that mathematical fact visible.
Depth-aware coloring Triangles are tinted by their recursion depth, so each level reads visually. Choose from rainbow, sunset, ocean, mono, or outline-only — useful for slides, posters, vinyl cuts, or laser engraving.

What Is the Sierpinski Triangle?

The Sierpinski triangle (also called the Sierpinski gasket or sieve) is a self-similar fractal first formally described by Polish mathematician Wacław Sierpiński in 1915. It is constructed by recursively removing the central inverted sub-triangle from every triangle that remains, leaving three smaller copies of the original at the corners. The process is repeated indefinitely; the limiting set has measure zero (no area at all) but contains uncountably many points and has a non-integer fractal dimension of log 3 / log 2 ≈ 1.5849625 — meaning it is "fatter" than a 1-dimensional curve but "thinner" than a 2-dimensional region.

The Chaos Game: Order from Randomness

The chaos game, popularized by Michael Barnsley in his 1988 book Fractals Everywhere, is one of the most striking results in dynamical systems. Pick any starting point inside the triangle and follow this rule: choose one of the three vertices uniformly at random, jump exactly halfway from your current point toward that vertex, and drop a dot. Repeat thousands of times. After a short burn-in period, every subsequent point lies on the Sierpinski triangle with probability 1 — the fractal is the unique attractor of this random walk. The deterministic recursive subdivision and the random chaos game are both instances of an Iterated Function System (IFS) with the same three midpoint maps; by the contraction mapping theorem, every IFS with strict contractions has a unique non-empty compact attractor that any randomized trajectory converges to.

Recursion Depth Reference

Depth NTriangles (3N)Side lengthArea remainingRemoved
01100%100%0%
1350%75%25%
2925%56.25%43.75%
32712.5%42.19%57.81%
4816.25%31.64%68.36%
52433.125%23.73%76.27%
67291.5625%17.80%82.20%
72,1870.78%13.35%86.65%
86,5610.39%10.01%89.99%
919,6830.20%7.51%92.49%

Where the Sierpinski Triangle Shows Up

  • Pascal's triangle modulo 2: color each cell of Pascal's triangle black if it's odd and white if it's even. The black cells form the Sierpinski triangle exactly — a stunning bridge between combinatorics and fractal geometry.
  • Cellular automaton Rule 90: the one-dimensional cellular automaton "Rule 90" of Stephen Wolfram, started from a single black cell, generates the Sierpinski triangle row by row.
  • Fractal antennas: Sierpinski monopole and dipole antennas exploit self-similarity to achieve multiband resonance — a single antenna can cover many frequency ranges. They are used in modern mobile phones and Wi-Fi devices.
  • Computer-science teaching: a canonical example for recursion, divide-and-conquer, IFS, and dimension theory. It also makes a great unit-test target for graphics libraries.
  • Generative art and design: textiles, logos, laser-engraved coasters, music-festival posters — the fractal's combination of mathematical depth and visual simplicity makes it endlessly remixable.
  • Tower of Hanoi state graph: the state graph of the Tower of Hanoi puzzle with N disks is exactly the depth-N Sierpinski graph — the same structure under a different cover.

Sierpinski Triangle vs Pascal's Triangle: A Surprising Identity

Write out Pascal's triangle for many rows, then color cells with odd binomial coefficients dark and cells with even coefficients light. The picture is a perfect Sierpinski triangle. The reason is Kummer's theorem on binomial coefficients modulo a prime: C(n, k) mod 2 equals 1 if and only if the binary representation of k is bit-wise less than or equal to that of n. Recursively this exactly produces the Sierpinski rule — three copies above, central one missing — and the limiting picture is the fractal. Switch this generator to "Pascal triangle layout" to see the connection in matching orientation.

Common Misconceptions

  • "The Sierpinski triangle has zero area." True — but only in the infinite limit. At any finite depth N, the leaves still fill (3/4)N of the outer area. At depth 9 that's still about 7.5%, plenty visible.
  • "You need an equilateral triangle to start." False. The recursion works on any triangle (right, obtuse, degenerate-as-long-as-not-collinear). The fractal shape is preserved by every affine transformation. Switch outer shapes in this tool to see for yourself.
  • "The chaos game requires special random numbers." No — uniform integer-3 randomness is enough. Any starting point also works (after a short burn-in to forget the start).
  • "Fractal dimension is just a fancy name for an integer." No — the Sierpinski triangle's dimension is genuinely between 1 and 2. There is no integer dimension that captures how it scales.

Frequently Asked Questions

What is the Sierpinski triangle?

A self-similar fractal built by recursively removing the central sub-triangle from every triangle in the figure. Three smaller copies of the whole shape sit at the corners of the original — at every scale, the same pattern repeats. First formally described by Wacław Sierpiński in 1915.

What is its Hausdorff dimension?

log 3 / log 2 ≈ 1.5849625. It is "fatter" than a 1D curve but "thinner" than a 2D region — the dimension captures the fact that doubling the resolution reveals 3 (not 4) self-similar copies of the fractal.

What is the chaos game?

A random algorithm that converges to a fractal attractor. For the Sierpinski triangle: start at any point inside the triangle, then repeatedly pick a vertex at random and jump halfway toward it, dropping a dot at each step. After thousands of iterations the dots accumulate exactly on the Sierpinski triangle.

Why do randomness and recursion produce the same fractal?

Both algorithms are instances of an Iterated Function System (IFS) with the same three contractions (midpoint maps toward each vertex). By the contraction-mapping theorem, the IFS has a unique non-empty compact attractor — the Sierpinski triangle — and almost every randomized trajectory converges to it.

How many triangles at depth N?

3N. Depth 0 has 1, depth 1 has 3, depth 2 has 9, depth 3 has 27, depth 4 has 81, depth 5 has 243, depth 6 has 729, depth 7 has 2,187, depth 8 has 6,561, and depth 9 has 19,683 — the maximum this tool will draw.

How much area is left at depth N?

(3/4)N of the original. Depth 1 keeps 75%, depth 5 keeps about 24%, depth 10 keeps only about 5.6%, and the infinite limit has zero area.

Does the outer triangle have to be equilateral?

No. The Sierpinski recursion works on any triangle. The fractal-shape pattern is preserved by every affine transformation, so right triangles, isoceles triangles, and even very stretched layouts all produce a valid Sierpinski triangle.

What is the connection to Pascal's triangle?

If you color the odd entries of Pascal's triangle and ignore the even ones, the result is exactly the Sierpinski triangle. This is a consequence of Kummer's theorem on binomial coefficients modulo 2.

What practical use does it have?

Fractal antenna design (multiband mobile-phone antennas), cellular-automaton studies (Rule 90 generates the Sierpinski triangle row by row), computer-graphics test patterns, recursion and IFS teaching, and laser-engraved or vinyl-cut generative art. It is also the state graph of the Tower of Hanoi puzzle.

Can I export the fractal?

Yes. SVG download produces a scalable vector file (perfect for print, laser-cutting, or further editing). PNG download rasterizes at 2× resolution for chat and slides. Copy stats puts the depth, leaf count, area, and Hausdorff dimension on your clipboard as CSV.

Reference this content, page, or tool as:

"Sierpinski Triangle Generator" at https://MiniWebtool.com/sierpinski-triangle-generator/ from MiniWebtool, https://MiniWebtool.com/

by miniwebtool team. Updated: 2026-05-21

Related MiniWebtools:

General Tools:

Top & Updated:

Random PickerRandom Name PickerInstagram User ID LookupFPS ConverterLine CounterRelative Standard Deviation CalculatorSort NumbersMAC Address GeneratorImage ResizerBatting Average CalculatorRemove SpacesERA CalculatorFacebook User ID LookupWord to Phone Number ConverterRandom Truth or Dare GeneratorFeet and Inches to Cm ConverterMAC Address LookupSun, Moon & Rising Sign Calculator 🌞🌙✨Sum CalculatorPercent Off CalculatorSlope and Grade CalculatorBitwise CalculatorMP3 LooperAudio SplitterInvisible Text GeneratorRandom IMEI GeneratorRoman Numerals ConverterRandom Credit Card GeneratorSHA256 Hash GeneratorLog Base 10 CalculatorNumber of Digits CalculatorWord Ladder GeneratorAI Text HumanizerRandom Superpower GeneratorRandom Quote Generator📷 OCR / Image to TextHalfway Date CalculatorPhone Number ExtractorMerge VideosWAR CalculatorCm to Feet and Inches ConverterMaster Number CalculatorVertical Jump CalculatorOn Base Percentage CalculatorSalary Conversion CalculatorSquare Root (√) CalculatorRandom Birthday Generator⬛ Aspect Ratio CalculatorOPS CalculatorRandom Poker Hand GeneratorRandom Activity GeneratorSlugging Percentage CalculatorRandom Fake Address GeneratorRandom Meal GeneratorSaturn Return CalculatorFile Size ConverterLeap Years ListText FormatterCompound Growth CalculatorBinary to Gray Code ConverterNumber to Word ConverterCaffeine Overdose CalculatorRandom Writing Prompt GeneratorRandom Movie PickerName Number CalculatorOctal Calculator📅 Date CalculatorBattery Life CalculatorCompare Two StringsRandom Loadout GeneratorVideo to Image ExtractorIP Subnet CalculatorBCD to Decimal ConverterCM to Inches ConverterDecimal to BCD ConverterLove Compatibility CalculatorStair CalculatorConnect the Dots GeneratorAdd Prefix and Suffix to TextMercury Retrograde CalendarPER Calculator🖱️ Click CounterFirst n Digits of PiQuotient and Remainder CalculatorYouTube Channel StatisticsAdd Text to ImageOutlier CalculatorArc Length CalculatorImage SplitterPercent Growth Rate CalculatorSHA512 Hash GeneratorBingo Card GeneratorImage CompressorRemove AccentWhat is my Lucky Number?Gray Code to Binary ConverterDay of the Year Calculator - What Day of the Year Is It Today?What is my Zodiac Sign?Weight Loss CalculatorList of Prime NumbersTime Duration CalculatorLottery Number GeneratorAcreage CalculatorRandom Object GeneratorURL ExtractorVideo Compressor🎰 Gacha Pity CalculatorSmall Text Generator ⁽ᶜᵒᵖʸ ⁿ ᵖᵃˢᵗᵉ⁾IP Address to Hex ConverterAstrological Element Balance CalculatorDiff CheckerFlip VideoRemove Leading Trailing SpacesAngel Number CalculatorBreak Line by CharactersBinary to BCD ConverterMartingale Strategy CalculatorAI Language DetectorRandom Time GeneratorMultiple Fraction CalculatorRandom Line PickerNumber ExtractorCone Flat Pattern (Template) GeneratorMorse Code GeneratorProportion CalculatorPVIF CalculatorAI Punctuation AdderP/E Ratio CalculatorFraction CalculatorSum of Positive Integers CalculatorVideo SplitterDay of Year CalendarLife Path Number CalculatorRandom User-Agent GeneratorHeight Percentile CalculatorRandom Number PickerBonus CalculatorWHIP CalculatorCollage MakerHypotenuse CalculatorAdjust Video SpeedDestiny Number CalculatorModulo CalculatorRandom Chord GeneratorRandom Emoji GeneratorPVIFA CalculatorBcrypt Hash Generator / CheckerList RandomizerAntilog CalculatorRandom Chess Opening GeneratorWord Scramble GeneratorMandelbrot Set ExplorerPercent to PPM ConverterPercentile CalculatorLunar Calendar ConverterRatio to Percentage CalculatorShort Selling Profit CalculatorLongest Day of the YearRandomize NumbersFirst n Digits of eColor InverterSquare Numbers ListLong Division CalculatorEmail ExtractorRandom Group GeneratorYouTube Tag ExtractorDMS to Decimal Degrees Converter🎮 Game Sensitivity ConverterIs it a Prime Number?Boxing Punch Power CalculatorLog (Logarithm) CalculatorAI ParaphraserSteel Weight CalculatorCrossword Puzzle MakerHebrew Calendar ConverterMultiplication CalculatorName RandomizerExponential Decay CalculatorRock Paper Scissors GeneratorTrigonometric Equation SolverMiter Angle CalculatorMAC Address AnalyzerDecking CalculatorNumber Randomizer🔍 Plagiarism CheckerRemove Line BreaksBoiling Point CalculatorHTML CompressorMolarity CalculatorRandom Name GeneratorStandard Error CalculatorField Goal Percentage CalculatorGrade CalculatorTaco Bar CalculatorCoin FlipperFence CalculatorText to Speech ReaderCatalan Number GeneratorSort Lines AlphabeticallyHex to BCD ConverterBCD to Binary ConverterBCD to Hex ConverterMedian CalculatorAverage CalculatorReverse VideoRemove Audio from VideoActual Cash Value CalculatorScientific Notation to Decimal ConverterLog Base 2 CalculatorRoot Mean Square CalculatorSHA3-256 Hash GeneratorAI Sentence ExpanderLbs to Kg ConverterHex to Decimal ConverterConvolution CalculatorRandom String GeneratorAmortization CalculatorMarkup CalculatorDecimal to Hex ConverterInstagram Font GeneratorSocial Media Image Size GuideTikTok Money CalculatorTwitter/X Character CounterTwitter/X Timestamp ConverterYouTube Watch Time CalculatorTwitch Earnings CalculatorYouTube Shorts Monetization CalculatorFacebook Ad Cost CalculatorSocial Media ROI CalculatorSocial Media Post Time OptimizerSocial Media Username CheckerCTR CalculatorROAS CalculatorInfluencer ROI CalculatorForce CalculatorAcceleration CalculatorVelocity CalculatorMomentum CalculatorProjectile Motion CalculatorKinetic Energy CalculatorPotential Energy CalculatorWork and Power CalculatorDensity CalculatorPressure CalculatorIdeal Gas Law CalculatorFree Fall CalculatorTorque CalculatorHorsepower CalculatorDilution CalculatorChemical Equation BalancerStoichiometry CalculatorPercent Yield CalculatorEmpirical Formula CalculatorTitration CalculatorMole/Gram/Particle ConverterIrregular Polygon Area CalculatorFrustum CalculatorTorus Calculator3D Distance CalculatorGreat Circle Distance CalculatorCircumscribed Circle (Circumcircle) CalculatorInscribed Circle (Incircle) CalculatorAngle Bisector CalculatorTangent Line to Circle CalculatorHeron's Formula CalculatorCoordinate Geometry Distance CalculatorVolume of Revolution CalculatorSurface of Revolution CalculatorParametric Curve GrapherRiemann Sum CalculatorTrapezoidal Rule CalculatorSimpson's Rule CalculatorImproper Integral CalculatorL'Hôpital's Rule CalculatorMaclaurin Series CalculatorPower Series CalculatorSeries Convergence Test CalculatorInfinite Series Sum CalculatorAverage Rate of Change CalculatorInstantaneous Rate of Change CalculatorRelated Rates SolverOptimization Calculator (Calculus)Gradient Calculator (Multivariable)Divergence CalculatorCurl CalculatorLine Integral CalculatorSurface Integral CalculatorJacobian Matrix CalculatorNewton's Method CalculatorRREF Calculator (Row Echelon Form)Matrix Inverse CalculatorMatrix Multiplication CalculatorDot Product CalculatorCross Product CalculatorVector Magnitude CalculatorUnit Vector CalculatorAngle Between Vectors CalculatorNull Space CalculatorColumn Space CalculatorCramer's Rule CalculatorMatrix Diagonalization CalculatorQR Decomposition CalculatorCholesky Decomposition CalculatorMatrix Power CalculatorCharacteristic Polynomial CalculatorBayes' Theorem CalculatorF-Test / F-Distribution CalculatorHypergeometric Distribution CalculatorNegative Binomial Distribution CalculatorGeometric Distribution CalculatorExponential Distribution CalculatorWeibull Distribution CalculatorBeta Distribution CalculatorSpearman Rank Correlation CalculatorFisher's Exact Test CalculatorContingency Table CalculatorOdds Ratio CalculatorROT13 Encoder/DecoderAtbash Cipher ToolVigenère Cipher ToolPronunciation IPA ConverterHemingway-Style Readability EditorSentence Length Variance AnalyzerWord Frequency AnalyzerBusiness Days CalculatorAdd Business Days to DateDate Pattern GeneratorHow Long Until CalculatorHow Long Ago CalculatorBirthday Across Cultures CalculatorHijri Calendar ConverterInsulin Sensitivity Factor CalculatorCarb-to-Insulin Ratio CalculatorLean Body Mass to Strength CalculatorOne-Mile Walk Test (Rockport) CalculatorCooper 12-Minute Run CalculatorFFMI CalculatorAPGAR Score CalculatorGlasgow Coma Scale CalculatorWells Score Calculator (DVT/PE)Tennis Score TrackerSoccer xG (Expected Goals) CalculatorCricket Run Rate CalculatorRugby Points CalculatorRace Time PredictorSwimming SWOLF CalculatorYoga Pose Hold TimerFishing Knot Strength CalculatorBike Gear Ratio CalculatorClimbing Grade ConverterWine Pairing SuggesterStandard Drink CalculatorCaffeine Half-Life TrackerSpice Substitution FinderDietary Restriction Recipe FilterMarinade Time CalculatorFermentation Time CalculatorSmoking Wood Pairing GuideFreelance Project Pricing CalculatorSaaS Pricing CalculatorSubscription Cost TrackerSide Hustle ROI CalculatorRemote Work Savings CalculatorCoffee Habit Cost CalculatorGym vs Home Workout Cost CalculatorLunch Cost CalculatorWealth Growth Visualizer1031 Exchange CalculatorRental Yield CalculatorCash-on-Cash Return CalculatorBRRRR Method CalculatorSection 8 Rent CalculatorRoommate Rent SplitterAirbnb Pricing OptimizerStatute of Limitations CalculatorSentence Reduction CalculatorSales Tax Nexus CheckerPatent Filing Fee CalculatorTrademark Class FinderWill Asset Distribution CalculatorWorkers' Compensation CalculatorStopping Distance CalculatorTrip Cost SplitterVehicle Weight Distribution CalculatorTrailer Tongue Weight CalculatorTire Tread Wear CalculatorEngine Compression Ratio CalculatorHeadlight Beam Distance CalculatorCat Litter Box CalculatorAquarium Heater Wattage CalculatorBird Cage Size CalculatorReptile Habitat UVB CalculatorPet Travel Crate Size FinderHorse Hay CalculatorCrochet Hook Size ConverterKnitting Needle Size ConverterKnitting Pattern CalculatorCross-Stitch Floss CalculatorQuilt Binding CalculatorOrigami Paper Size CalculatorPottery Clay Shrinkage CalculatorBeading Pattern CalculatorResin Casting Volume CalculatorEmbroidery Thread Length CalculatorHiking Pace Calculator (Naismith's Rule)Backpacking Food Weight CalculatorTent Footprint Size CalculatorSleeping Bag Temperature Rating GuideKnot Tying Reference ToolStar Visibility CalculatorTide Time CalculatorSun Position CalculatorReynolds Number CalculatorBernoulli Equation CalculatorHeat Transfer CalculatorThermal Expansion CalculatorSpecific Heat Capacity CalculatorGear Ratio Calculator (Mechanical)Pulley System CalculatorHydraulic Cylinder Force CalculatorBelt Length CalculatorCloset Capsule CalculatorStorage Unit Size CalculatorMoving Box Quantity Calculator