Simplify Your Workflow: Search MiniWebtool.
Add Extension
> 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// from MiniWebtool, https://MiniWebtool.com/

by miniwebtool team. Updated: 2026-05-21

Top & Updated:

Random PickerRandom Name PickerLine CounterBatting Average CalculatorFPS ConverterRelative Standard Deviation CalculatorSort NumbersInstagram User ID LookupMAC Address GeneratorRemove SpacesERA CalculatorJob FinderWord to Phone Number ConverterFeet and Inches to Cm ConverterMAC Address LookupFacebook User ID LookupRandom Truth or Dare GeneratorSum CalculatorOPS CalculatorPercent Off CalculatorSquare Root (√) CalculatorLog Base 10 CalculatorSHA256 Hash GeneratorBitwise CalculatorNumber of Digits CalculatorPhone Number ExtractorImage ResizerVertical Jump CalculatorSlope and Grade CalculatorMP3 LooperOn Base Percentage CalculatorSalary Conversion CalculatorAudio SplitterRoman Numerals ConverterRandom IMEI GeneratorRandom Letter GeneratorRandom Quote GeneratorSlugging Percentage CalculatorNumber to Word ConverterAI Text HumanizerRandom Poker Hand GeneratorCaffeine Overdose CalculatorRandom Loadout GeneratorRandom Activity GeneratorSun, Moon & Rising Sign Calculator 🌞🌙✨Decimal to BCD ConverterRandom Movie PickerMerge VideosSaturn Return CalculatorCm to Feet and Inches ConverterBCD to Decimal ConverterRandom Fake Address GeneratorWAR CalculatorText FormatterVideo to Image ExtractorBinary to Gray Code ConverterCompound Growth CalculatorOctal CalculatorInvisible Text GeneratorTime Duration CalculatorRandom Writing Prompt GeneratorFile Size ConverterLove Compatibility CalculatorRandom Credit Card GeneratorFirst n Digits of PiMaster Number CalculatorWHIP CalculatorQuotient and Remainder CalculatorGrade Calculator⬛ Aspect Ratio CalculatorSteel Weight CalculatorRandom Time GeneratorAdd Prefix and Suffix to TextImage CompressorRemove AccentCompare Two StringsRandom Sound Frequency GeneratorYouTube Channel StatisticsDay of Year CalendarPercent Growth Rate CalculatorWord Ladder GeneratorRandom Superpower GeneratorRandom Object GeneratorBaby Growth Percentile CalculatorOutlier CalculatorCM to Inches ConverterClothing Size ConverterName Number CalculatorBreak Line by CharactersAdd Text to ImageGray Code to Binary ConverterBattery Life CalculatorRandom Number PickerRandom Birthday GeneratorSHA512 Hash GeneratorLeap Years ListIP Subnet CalculatorArc Length CalculatorSum of Positive Integers CalculatorEmail ExtractorURL ExtractorAI ParaphraserAI Punctuation AdderList of Prime NumbersDay of the Year Calculator - What Day of the Year Is It Today?Video CompressorBinary to BCD ConverterIP Address to Hex ConverterSort Lines AlphabeticallyHex to BCD ConverterBCD to Binary ConverterLottery Number GeneratorBCD to Hex ConverterMedian CalculatorStandard Error CalculatorList RandomizerAverage CalculatorModulo CalculatorPVIFA CalculatorReverse VideoHypotenuse CalculatorRemove Audio from VideoActual Cash Value CalculatorScientific Notation to Decimal ConverterNumber ExtractorAngel Number CalculatorLog Base 2 CalculatorRoot Mean Square CalculatorSHA3-256 Hash GeneratorAI Sentence Expander📅 Date CalculatorLbs to Kg ConverterHex to Decimal ConverterRandom Group GeneratorConvolution CalculatorMAC Address AnalyzerRandom String GeneratorRemove Leading Trailing SpacesAmortization CalculatorMarkup 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 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 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 CalculatorRelative Risk CalculatorEffect Size CalculatorPermutations with Repetition CalculatorModular Exponentiation CalculatorPrimitive Root CalculatorPerfect Number CheckerAmicable Number CheckerTwin Prime FinderMersenne Prime CheckerGoldbach Conjecture VerifierMöbius Function CalculatorEgyptian Fraction CalculatorFibonacci Number CheckerDigital Root CalculatorPartition Function CalculatorBoolean Algebra SimplifierKarnaugh Map (K-Map) SolverLogic Gate SimulatorGraph Coloring CalculatorTopological Sort CalculatorAdjacency Matrix CalculatorRecurrence Relation SolverInclusion-Exclusion CalculatorLinear Programming SolverTraveling Salesman Solver (TSP)Hamiltonian Path CheckerPlanar Graph CheckerNetwork Flow Calculator (Max Flow)Stable Marriage Problem SolverFirst-Order ODE SolverSecond-Order ODE SolverDirection Field / Slope Field PlotterEuler's Method CalculatorBernoulli ODE SolverSystem of ODEs SolverGroup Theory Order CalculatorRing and Field CalculatorJordan Normal Form CalculatorMatrix Exponential CalculatorTensor Product CalculatorFast Fourier Transform (FFT) CalculatorZ-Transform CalculatorNumerical Integration CalculatorTOML to JSON ConverterJSON to CSV ConverterXML to JSON ConverterSQL to MongoDB Query ConverterCSS Flexbox PlaygroundCSS Grid GeneratorJWT GeneratorBcrypt Hash Generator / CheckerColor Code Converter (All Formats)Git Command Generator.env File GeneratorLorem Picsum / Placeholder Image GeneratorText to Binary/Hex/ASCII ConverterSyllable CounterSentence CounterParagraph CounterSpeaking Time CalculatorReading Time CalculatorWhitespace VisualizerStrikethrough Text GeneratorTorque Converter (Nm, ft-lb, kgf-cm)Data Transfer Rate ConverterFuel Efficiency ConverterAstronomical Unit ConverterRing Size ConverterPaper Size ReferenceGas Mileage CalculatorEV Range CalculatorEV Charging Time Calculator0–60 / Quarter Mile CalculatorCar Lease CalculatorVehicle Towing Capacity CalculatorExposure Triangle CalculatorCrop Factor CalculatorMegapixel to Print Size CalculatorPhoto File Size EstimatorMusic BPM TapperMusic Key TransposerVideo Bitrate CalculatorSeed Germination Rate CalculatorFertilizer Calculator (NPK)Raised Bed Soil CalculatorFrost Date CalculatorLawn Fertilizer CalculatorCompost Calculator (C:N Ratio)Solar Panel CalculatorSolar ROI CalculatorHome Energy Audit CalculatorAppliance Energy Cost CalculatorWater Usage CalculatorElectricity Generation Cost CalculatorHeat Loss CalculatorFlight Distance CalculatorTravel Budget CalculatorJet Lag CalculatorPacking List GeneratorTip Splitter (Advanced)Lease vs Buy CalculatorHourly Rate Calculator (Freelancer)Invoice Late Fee CalculatorESPP CalculatorStock Split CalculatorOptions Probability CalculatorDollar to Gold ConverterBeam Load CalculatorPipe Flow CalculatorBolt Torque CalculatorGravel, Sand & Topsoil CalculatorRandom Sentence GeneratorRandom Paragraph GeneratorRandom Math Problem GeneratorRandom Bible Verse GeneratorRandom Cat/Dog Name GeneratorRandom Debate Topic GeneratorBody Recomposition CalculatorAlcohol Calorie CalculatorMedication Dosage CalculatorPace to Calories CalculatorHydration CalculatorTrain Meeting Problem SolverAge Word Problem SolverMixture Problem SolverWork Rate Problem SolverDistance-Speed-Time Triangle CalculatorCoin Word Problem SolverNumber Bonds GeneratorCarry and Borrow VisualizerTimes Tables QuizMental Math TrainerRoman Numeral Math SolverEgyptian Multiplication CalculatorVedic Math Tricks CalculatorRussian Peasant MultiplicationSoroban Abacus SimulatorAnnuity Payout CalculatorReverse Mortgage CalculatorVariable Annuity CalculatorFixed Indexed Annuity CalculatorBond Convexity CalculatorBond Duration Calculator (Macaulay & Modified)Forward Rate CalculatorMortgage Recast CalculatorTreasury Inflation-Protected Securities (TIPS) CalculatorStock Beta CalculatorTreynor Ratio CalculatorSortino Ratio CalculatorDoppler Effect CalculatorSpring Constant CalculatorPendulum Period CalculatorCentripetal Force CalculatorAngular Velocity CalculatorMoment of Inertia CalculatorSnell's Law CalculatorCoulomb's Law CalculatorElectric Field CalculatorMagnetic Field of Wire CalculatorLens Equation CalculatorA/B Test Significance CalculatorA/B Test Sample Size CalculatorConversion Rate CalculatorCustomer Lifetime Value (CLV) CalculatorCustomer Acquisition Cost (CAC) CalculatorChurn Rate CalculatorRetention Rate Cohort CalculatorNPS (Net Promoter Score) CalculatorPareto Chart GeneratorSix Sigma Process Capability CalculatorTessellation GeneratorSpirograph GeneratorVoronoi Diagram GeneratorDelaunay Triangulation GeneratorL-System Fractal GeneratorMandelbrot Set ExplorerJulia Set GeneratorPolar Equation Plotter3D Surface PlotterSierpinski Triangle GeneratorcURL Command BuilderHTTP Status Code Reference