Simplify Your Workflow: Search MiniWebtool.
Add Extension
See also
Tessellation GeneratorL-System Fractal GeneratorDelaunay Triangulation GeneratorRandom Bible Verse GeneratorShoelace Formula Calculator
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

General Tools:

Top & Updated:

Instagram User ID LookupRandom Name PickerRandom PickerImage ResizerFacebook User ID LookupLine CounterSort NumbersFPS ConverterRelative Standard Deviation CalculatorSun, Moon & Rising Sign Calculator 🌞🌙✨Remove SpacesRandom Quote GeneratorWord to Phone Number ConverterFeet and Inches to Cm ConverterMAC Address GeneratorERA CalculatorCm to Feet and Inches ConverterJob Finder📷 OCR / Image to Text⬛ Aspect Ratio CalculatorMAC Address LookupSum CalculatorSquare Root (√) CalculatorBatting Average CalculatorSlope and Grade CalculatorSHA256 Hash GeneratorPercent Off Calculator🖱️ Click CounterMP3 LooperMerge VideosRandom Truth or Dare GeneratorWeight Loss CalculatorRandom Credit Card GeneratorVertical Jump CalculatorSun Position CalculatorBitwise CalculatorNumber of Digits CalculatorAdd Text to ImageNumber to Word ConverterPhone Number ExtractorImage SplitterRandom Fake Address GeneratorRandom IMEI GeneratorCaffeine Overdose CalculatorAudio SplitterInvisible Text GeneratorRandom Poker Hand GeneratorRoman Numerals ConverterSalary Conversion CalculatorRandom Activity GeneratorMaster Number CalculatorText FormattereBay Fee CalculatorWord Ladder GeneratorLog Base 10 CalculatorCompound Growth CalculatorRandom Superpower GeneratorRandom Birthday GeneratorRandom Movie PickerOctal CalculatorRandom Writing Prompt GeneratorHalfway Date CalculatorYouTube Channel StatisticsIP Subnet CalculatorBolt Torque CalculatorRandom Playing Card GeneratorLunar Calendar ConverterRandom Meal GeneratorImage CompressorBinary to BCD ConverterOPS CalculatorStair CalculatorDecimal to BCD ConverterFile Size ConverterName RandomizerSHA512 Hash GeneratorMercury Retrograde CalendarVideo CompressorEmail ExtractorLong Division CalculatorRandom Loadout Generator📅 Date CalculatorBinary to Gray Code ConverterHebrew Calendar ConverterVideo to Image ExtractorLeap Years ListSocial Media Username CheckerWord Scramble GeneratorRandom Chord GeneratorBattery Life CalculatorQuotient and Remainder CalculatorPercent Growth Rate CalculatorFirst n Digits of PiCompare Two StringsBCD to Decimal ConverterBreak Line by CharactersAPI TesterBingo Card GeneratorList of Prime NumbersFlip VideoYouTube Tag ExtractorLED Resistor CalculatorJulian Date ConverterBcrypt Hash Generator / CheckerRandomize NumbersAcreage CalculatorSaturn Return CalculatorVideo SplitterRandom Emoji GeneratorRandom Number PickerOutlier CalculatorSlugging Percentage CalculatorMartingale Strategy CalculatorWAR Calculator🔍 Plagiarism CheckerMD5 Hash GeneratorWHIP CalculatorModulo CalculatorWhat is my Zodiac Sign?CM to Inches ConverterOn Base Percentage CalculatorArc Length CalculatorRandom Tournament Bracket GeneratorNumber ExtractorRandom Chess Opening GeneratorIP Address to Hex ConverterLove Compatibility Calculator🎰 Gacha Pity CalculatorConnect the Dots GeneratorRemove AccentAdd Prefix and Suffix to TextList RandomizerCone Flat Pattern (Template) GeneratorBCD to Binary ConverterDay of the Year Calculator - What Day of the Year Is It Today?Day of Year Calendar🔊 Tone GeneratorGray Code to Binary ConverterReverse VideoSocial Media Post Time OptimizerURL ExtractorImage CropperSmall Text Generator ⁽ᶜᵒᵖʸ ⁿ ᵖᵃˢᵗᵉ⁾Sigma Notation Calculator (Summation)AI Language DetectorMultiplication CalculatorRatio to Percentage CalculatorYouTube Thumbnail DownloaderBroken Link CheckerFraction CalculatorGolden Ratio CalculatorLbs to Kg ConverterBase64 DecoderMultiple Fraction CalculatorPercentage Increase CalculatorAstrological Element Balance CalculatorRandom Group GeneratorRatio CalculatorTrigonometric Equation SolverMAC Address AnalyzerPercent to PPM ConverterDMS to Decimal Degrees ConverterParabola CalculatorHeight Percentile CalculatorText Case ConverterTime Duration CalculatorDecibel (dB) CalculatorProportion CalculatorRandom Math Problem GeneratorBiological Age CalculatorImage EnhancerAm I Overweight?Color InverterAdjust Video SpeedWhat is my Lucky Number?Am I Underweight?Effect Size CalculatorRandom User-Agent GeneratorAI Text HumanizerPipe Flow CalculatorWater Usage Calculator1099 Tax CalculatorHTML CompressorRandom Time GeneratorYouTube Comment PickerFirst n Digits of eRandom Line PickerName Number CalculatorRandom Object GeneratorTaco Bar CalculatorConvolution CalculatorAI Punctuation AdderEstimation CalculatorMental Math TrainerMolarity CalculatorTwitter/X Timestamp ConverterHousing Appreciation CalculatorRandom PIN GeneratorAI ParaphraserSort Lines AlphabeticallyHex to BCD ConverterLottery Number GeneratorBCD to Hex ConverterMedian CalculatorStandard Error CalculatorAverage CalculatorPVIFA CalculatorHypotenuse CalculatorRemove Audio from VideoActual Cash Value CalculatorScientific Notation to Decimal ConverterAngel Number CalculatorLog Base 2 CalculatorRoot Mean Square CalculatorSum of Positive Integers CalculatorSHA3-256 Hash GeneratorAI Sentence ExpanderHex to Decimal ConverterRandom String GeneratorRemove Leading Trailing SpacesMarkup CalculatorPVIF CalculatorDecimal to Hex ConverterInstagram Font GeneratorSocial Media Image Size GuideTikTok Money CalculatorTwitter/X Character CounterYouTube Watch Time CalculatorTwitch Earnings CalculatorYouTube Shorts Monetization CalculatorFacebook Ad Cost CalculatorSocial Media ROI CalculatorCTR 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 CalculatorBoiling Point 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 CalculatorBernoulli Equation CalculatorAP Score CalculatorAttendance Percentage CalculatorPercentage to CGPA ConverterCitation Generator (APA/MLA/Chicago)AI Quiz GeneratorAI Lesson Plan GeneratorInteractive Periodic TableElectron Configuration CalculatorLimiting Reactant CalculatorTheoretical Yield CalculatorHenderson-Hasselbalch CalculatorpKa to Ka ConverterMolality CalculatorNormality CalculatorPercent Composition CalculatorFreezing Point Depression CalculatorBoiling Point Elevation CalculatorOsmotic Pressure CalculatorNernst Equation CalculatorBeer-Lambert Law CalculatorGravitational Force CalculatorEscape Velocity CalculatorKepler's Third Law CalculatorTime Dilation CalculatorE=mc² CalculatorPhoton Energy Calculatorde Broglie Wavelength CalculatorTerminal Velocity CalculatorBuoyancy CalculatorWave Speed CalculatorSpeed of Sound CalculatorMechanical Advantage CalculatorInclined Plane CalculatorFriction CalculatorResistors in Series CalculatorWatts to Amps CalculatorAmps to Watts CalculatorkVA Calculator3-Phase Power CalculatormAh to Wh ConverterGenerator Size CalculatorLumens to Watts ConverterLux to Lumens CalculatorRoom Lighting CalculatorInductive Reactance CalculatorSeries/Parallel Capacitor CalculatorConduit Fill CalculatorAntenna Length CalculatorCubic Yard CalculatorAsphalt CalculatorSod CalculatorGrass Seed CalculatorDeck Stain CalculatorSiding CalculatorBaseboard & Trim CalculatorBaluster Spacing CalculatorEpoxy Resin CalculatorWater Heater Size CalculatorPool Volume CalculatorPool Salt CalculatorPond Volume & Liner CalculatorTV Size CalculatorTV Mounting Height CalculatorPicture Hanging Height CalculatorRug Size CalculatorCurtain Size CalculatorCeiling Fan Size CalculatorDehumidifier Size CalculatorAir Purifier CADR CalculatorFirewood Cord CalculatorCouch Fit CalculatorEngine Displacement Calculator2-Stroke Oil Mix CalculatorOctane Mix CalculatorLease Buyout CalculatorCost Per Mile CalculatorTire Load Index & Speed Rating LookupWheel Offset CalculatorWilks & DOTS CalculatorACFT Score CalculatorRowing Pace CalculatorHiking Time CalculatorBeep Test CalculatorFTP & Power Zones CalculatorRunning Age-Grading CalculatorHeart Rate Recovery CalculatorElo Rating CalculatorK/D Ratio CalculatorNet Run Rate CalculatorBatting Strike Rate CalculatorBowling Economy CalculatorDart Checkout CalculatorStableford CalculatorSpeedrun Split TimerBike Size CalculatorSnowboard Size CalculatorHat Size ConverterGlove Size CalculatorHelmet Size CalculatorSki Size CalculatorSurfboard Volume CalculatorTennis Grip Size CalculatorBackpack Size CalculatorCelsius to Fahrenheit ConverterFahrenheit to Celsius ConverterKm to Miles ConverterMiles to Km ConverterMM to Inches ConverterInches to MM ConverterStone to Kg ConverterKg to Stone ConverterLiters to Gallons ConverterGallons to Liters ConverterML to Oz ConverterOz to ML ConverterSquare Meters to Square Feet ConverterSquare Feet to Square Meters ConverterCubic Feet to Cubic Yards ConverterCubic Meters to Cubic FeetKnots to MPH ConverterMPH to KMH / KMH to MPHMg to Ml ConverterAI Text SummarizerAI TranslatorAI Story GeneratorAI Poem GeneratorAI Song Lyrics Generator