Simplify Your Workflow: Search MiniWebtool.
Add Extension

My Toolbox

Automatic Mode

No saved tools yet.

Go Premium
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 PickerRandom Name Picker WheelImage ResizerFacebook User ID LookupLine CounterSort NumbersRSD Calculator - Relative Standard DeviationFPS ConverterRemove SpacesSun, Moon & Rising Sign Calculator 🌞🌙✨Random Quote Generator🖱️ Click Counter⬛ Aspect Ratio CalculatorWord to Phone Number ConverterMAC Address Lookup📷 OCR / Image to TextMAC Address GeneratorRandom Credit Card GeneratorJob FinderERA CalculatorMerge VideosJulian Date ConverterPercent Off CalculatorSquare Root (√) CalculatorSHA256 Hash GeneratorCm to Feet and Inches ConverterSum CalculatorSlope and Grade CalculatorWeight Loss CalculatorRoman Numerals ConverterBatting Average CalculatorIP Subnet CalculatorRandom Fake Address GeneratorMP3 LooperNumber of Digits CalculatorAdd Text to ImageBCD ConverterVertical Jump CalculatorStandard Error CalculatorRandom Truth or Dare GeneratorAudio SplitterInvisible Text GeneratorBitwise CalculatorRandom IMEI GeneratorPhone Number ExtractorRandom Superpower GeneratorLog Base 10 CalculatorName RandomizerImage SplitterRandom Writing Prompt GeneratorFeet and Inches to Cm ConverterMaster Number CalculatorText FormatterSalary Conversion CalculatorHalfway Date CalculatorRandom Activity GeneratorOctal CalculatorNumber to Word ConverterVideo CompressorLunar Calendar ConverterYouTube Channel StatisticsCaffeine Overdose CalculatorLong Division CalculatorCompound Growth CalculatorQuotient and Remainder CalculatorRandom Poker Hand GeneratorSun Position CalculatorSHA512 Hash GeneratorFirst n Digits of PiLeap Years ListFraction CalculatorEstimation CalculatorMultiplication CalculatorHebrew Calendar ConverterBinary to Gray Code ConverterRandom Movie PickerBolt Torque CalculatorEmail ExtractorRandom Birthday GeneratorWord Ladder GeneratorRandom Video Thumbnail GeneratorMD5 Hash GeneratorOPS Calculator🔍 Plagiarism CheckerBingo Card GeneratorList RandomizerRandom Meal GeneratorModulo CalculatorCompare Two StringsEquation of a Line CalculatorFile Size ConverterStair CalculatorFlip VideoOutlier CalculatorImage CompressorLimit CalculatorLove Compatibility CalculatorPercent Growth Rate CalculatorRandom Loadout GeneratorBroken Link CheckerRandom Emoji GeneratorArc Length CalculatorList of Prime NumbersMultiple Fraction CalculatorOrder of Operations Calculator (PEMDAS)Video to Image ExtractorLong Multiplication Calculator📅 Date Calculator🎰 Gacha Pity CalculatorAI Language DetectorAPI TesterInequality SolverAstrological Element Balance CalculatorMagic 8-BallRemove Lines Containing...🔊 Tone GeneratorWHIP CalculatorBreak Line by CharactersDay of Year CalendarPercent to PPM ConverterURL ExtractorBcrypt Hash Generator / CheckerRandom User-Agent GeneratorRandom Tournament Bracket GeneratorNumber ExtractorAdd Prefix and Suffix to TextChinese Gender PredictorName Number CalculatorRandomize NumbersRandom Line PickerDay of the Year Calculator - What Day of the Year Is It Today?IP Address to Hex ConverterPaycheck Calculator (Take-Home Pay)WAR CalculatorCone Flat Pattern (Template) Generator📊 Bar Graph MakereBay Fee CalculatorSocial Media Username CheckerDomain and Range CalculatorRandom Group GeneratorScientific Notation to Decimal ConverterAI Text HumanizerRandom Number PickerSaturn Return CalculatorWhat is my Zodiac Sign?Random Math Problem GeneratorImage CropperYouTube Tag ExtractorWhat is my Lucky Number?Random Object GeneratorSlugging Percentage CalculatorAdjust Video SpeedSocial Media Post Time OptimizerRadical SimplifierWhitespace VisualizerConnect the Dots GeneratorAlgebraic Expression SimplifierSigma Notation Calculator (Summation)AI Punctuation AdderDMS to Decimal Degrees ConverterWord Scramble GeneratorSquare Numbers ListAcreage CalculatorColor InverterLottery Number GeneratorRemove AccentTrigonometric Equation SolverDecibel (dB) CalculatorLogarithmic Equation SolverMercury Retrograde CalendarSum of Positive Integers CalculatorBattery Life CalculatorOn Base Percentage CalculatorPER CalculatorRandom Chord GeneratorSmall Text Generator ⁽ᶜᵒᵖʸ ⁿ ᵖᵃˢᵗᵉ⁾Image EnhancerLED Resistor CalculatorRatio to Percentage CalculatorWHOIS LookupRandom Excuse GeneratorArithmetic Sequence CalculatorScientific Notation CalculatorWire Resistance CalculatorVideo SplitterQuote FinderRemove Empty LinesAverage Deviation CalculatorHypotenuse CalculatorLbs to Kg Converter1099 Tax CalculatorEffect Size CalculatorHeight Percentile CalculatorLogic Gate SimulatorRemove Leading Trailing SpacesWater Usage CalculatorBCD to Decimal ConverterGray Code to Binary ConverterAI ParaphraserBinary to BCD ConverterSort Lines AlphabeticallyHex to BCD ConverterBCD to Binary ConverterBCD to Hex ConverterMedian CalculatorAverage CalculatorPVIFA CalculatorReverse VideoRemove Audio from VideoActual Cash Value CalculatorAngel Number CalculatorLog Base 2 CalculatorRoot Mean Square CalculatorSHA3-256 Hash GeneratorAI Sentence ExpanderTime Duration CalculatorHex to Decimal ConverterConvolution CalculatorMAC Address AnalyzerRandom String GeneratorMarkup CalculatorPVIF 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 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 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 GeneratorMcg to Mg ConverterIndian Land Unit ConverterTola to Gram ConverterPX to REM ConverterPT to PX ConverterMerge PDFSplit PDFCompress PDFPDF to JPGJPG to PDFRotate PDFDelete PDF PagesAdd Page Numbers to PDFProtect PDFReorder PDF PagesPDF Word CounterPDF Page ExtractorPDF to Text ExtractorUnlock PDF (Owner-Password Removal)PDF Flatten ToolAI Rap Lyrics GeneratorAI Cover Letter GeneratorAI Resume Bullet GeneratorAI LinkedIn Headline & Bio GeneratorAI Instagram Caption GeneratorAI YouTube Title & Description GeneratorAI Video Script GeneratorAI Product Description GeneratorAI Press Release GeneratorAI Wedding Speech GeneratorAI Thank-You Note GeneratorAI Dream InterpreterRandom Question GeneratorWould You Rather GeneratorNever Have I Ever GeneratorIcebreaker Question GeneratorCharades GeneratorPictionary Word GeneratorHangman Word GeneratorTrivia Question GeneratorRandom Fact GeneratorRandom Joke GeneratorDad Joke GeneratorPickup Line GeneratorCompliment GeneratorDaily Affirmation GeneratorJournal Prompt GeneratorDrawing Idea GeneratorFortune Cookie GeneratorFantasy Name GeneratorCapacitor Bank Sizing CalculatorSolar Charge Controller Sizing CalculatorBattery C-Rate CalculatorBattery Internal Resistance CalculatorPeukert Battery Runtime CalculatorPCB Via Current CalculatorBand Name GeneratorRap Name GeneratorNickname GeneratorTeam Name GeneratorGamertag GeneratorConvert Video for Twitter (X)