onlinemathtools logo

Sierpinski carpet generator

World's simplest math tool

Free online Sierpinski carpet generator. Just press a button and you'll automatically get a Sierpinski carpet fractal. There are no ads, popups or nonsense, just an awesome Sierpinski carpet generator. Press a button, get a Sierpinski carpet. Created by mathematicians for mathematicians.
Carpet Size and Iterations
Carpet width.
Carpet height.
Number of recursive iterations.
Carpet Colors
Carpet background color.
Carpet line segment color.
Carpet square fill color.
Curve
Thickness of square edges.
Padding around the carpet.
Sierpinski carpet generator tool What is a sierpinski carpet generator?
This tool draws a Sierpinsky carpet. A Sierpinsky carpet is self-similar plane fractal structure. To construct it you cut it into 9 equal-sized smaller squares, and remove the central smaller square from all squares. You keep doing it as many times as you want. This tool lets you set how many cuts to make (number of iterations) and also set the carpet's width and height. If you use the download buttonm you'll be able to download the whole carpet that is exactly width-x-height in size. You can draw squares with any border width or no width at all. You can colorize a fractal with three different colors and you can also add offset padding around the edges of the carpet by setting the padding option. Mathabulous!
Sierpinski carpet generator examples Click to use
Generate a 3rd Order Sierpinski Carpet
This tool draws the Sierpinski carpet fractal with three different sizes of squares as the number of iterations is equal to 3. Here bright colors are used, on a canvas size of 558x558px.
Required options
These options will be used automatically if you select this example.
Carpet width.
Carpet height.
Number of recursive iterations.
Carpet background color.
Carpet line segment color.
Carpet square fill color.
Thickness of square edges.
Padding around the carpet.
Draw a Rectangular Sierpinski Fractal
This example generates a non-square Sierpinski carpet in blue colors with dimensions 558x450px using only 2 iterations.
Required options
These options will be used automatically if you select this example.
Carpet width.
Carpet height.
Number of recursive iterations.
Carpet background color.
Carpet line segment color.
Carpet square fill color.
Thickness of square edges.
Padding around the carpet.
Draw a Bicolour Sierpinsky Carpet
In this example we generate a Sierpinsky fractal in which a thickness of the line equals 0. As a result its drawn using only two colors. Here we're also using 4 recursive generations to show how complex it gets and we don't use any padding around the carpet edges.
Required options
These options will be used automatically if you select this example.
Carpet width.
Carpet height.
Number of recursive iterations.
Carpet background color.
Carpet line segment color.
Carpet square fill color.
Thickness of square edges.
Padding around the carpet.
Pro tips Master online math tools
You can pass options to this tool using their codes as query arguments and it will automatically compute output. To get the code of an option, just hover over its icon. Here's how to type it in your browser's address bar. Click to try!
https://onlinemathtools.com/generate-sierpinski-carpet?&width=558&height=558&iterations=3&background-color=%23d6005d&line-segment-color=white&fill-color=%23690007&line-width=8&padding=5
All math tools
Didn't find the tool you were looking for? Let us know what tool we are missing and we'll build it!
Quickly visualize rules of an Lindenmayer rewrite system.
Quickly generate a list of primes.
Quickly generate a list of Fibonacci numbers.
Quickly generate a list of extended, negative Fibonacci numbers.
Quickly generate a list of Fibonacci primes.
Quickly generate a list of Fibonacci words.
Quickly generate a list of Tribonacci words.
Quickly generate a list of Lucas numbers.
Quickly generate a list of extended, negative Lucas numbers.
Quickly generate a list of Lucas numbers that are also prime numbers.
Quickly generate a list of perfect numbers.
Quickly generate random numbers.
Quickly generate a list of look-and-say sequence numbers.
Quickly create a list of Prouhet-Thue-Morse sequence values.
Quickly create a list of dragon curve sequence values.
Quickly create a list of Oldenburger-Kolakoski sequence values.
Quickly create a list of Gijswijt sequence values.
Quickly create a list of Golay-Rudin-Shapiro sequence values.
Quickly create a list of Baum-Sweet sequence values.
Quickly generate π constant's digits to arbitrary precision.
Quickly calculate Euler constant's digits to arbitrary precision.
Quickly calculate φ constant's digits to arbitrary precision.
Quickly calculate factorials.
Quickly create a triangluar array of binomial coefficients.
Quickly find the transpose of a matrix.
Quickly find the inverse of a matrix.
Quickly calculate the determinant of a matrix.
Find the product of matrices.
Quickly draw a Hilbert space-filling curve.
Quickly draw a dragon space-filling curve.
Quickly draw a Peano space-filling curve.
Quickly draw a Moore space-filling curve.
Quickly draw a Peano-Gosper space-filling curve.
Quickly draw a Sierpinski arrowhead fractal curve.
Quickly draw a Sierpinski sieve fractal.
Quickly draw a Sierpinski closed plane fractal curve.
Quickly draw a Sierpinski carpet fractal.
Quickly draw a Koch island fractal curve.
Quickly draw a self-similar Levy C fractal curve.
Quickly draw a Vicsek snowflake fractal.
Quickly draw a T-square fractal.
Quickly draw a Cantor set fractal.
Quickly draw an asymmetric Cantor set fractal.
Quickly draw a generalized Cantor set fractal.
Quickly draw a Cantor dust fractal.
Quickly draw a Fibonacci word fractal.
Quickly generate a Morton Z-order fractal curve.
Coming soon These math tools are on the way
Find n-th e Digit
Calculate the n-th digit of Euler's number.
Find n-th Golden Ratio Digit
Calculate the n-th digit of Golden Ratio.
Find n-th Pi Digit
Calculate the n-th digit of pi constant.
Find Prime Factors
Given a number, factorize it and find its prime factors.
Test if a Number is a Prime
Find out if the given number is a prime number.
Test if a Number is a Fibonacci Number
Find out if the given number is a Fibonacci number.
Decode a Look-and-say Sequence
Perform the inverse operation on a look-and-say sequence.
Generate a Moser-de Bruijn Sequence
Create a list of Moser-de Bruijn sequence values.
Generate a Random Matrix
Create a matrix with random elements.
Generate an Identity Matrix
Create a matrix with ones along the diagonal.
Check if a Matrix is Singular
Determine if a matrix is degenerate.
Find the Co-factor Matrix
Given a matrix, find its cofactor matrix.
Find the Adjugate Matrix
Given a matrix, find its adjunct.
LU Factor a Matrix
Decompose a matrix into LU factors.
Find Matrix Eigenvalues
Find eigenvalues of a matrix.
Draw a Apollonian Gasket
Generate an Apollonian gasket fractal.
Draw a Mandelbrot Fractal
Generate a Mandelbrot fractal.
Draw a Julia Fractal
Generate a Julia fractal.
Draw a Rauzy Fractal
Generate a Rauzy fractal.
Draw a Quadric Cross Fractal
Generate a Quadric cross fractal.
Draw a Sierpinski Pentagon Fractal
Generate a Sierpinski pentagon fractal (also known as pentaflake).
Draw a Sierpinski Hexagon Fractal
Generate a Sierpinski hexagon fractal (also known as hexaflake).
Draw Smith-Volterra-Cantor Set Fractal
Generate a Smith-Volterra-Cantor set fractal.
Draw Blancmange Fractal Curve
Generate a Blancmange fractal.
Draw Weierstrass Function
Generate a Weierstrass fractal.
Draw Minkowski Question-mark Curve
Generate a Minkowski Question-mark fractal.
Draw Thomae's Function
Generate a Thomae's function (also known as popcorn or raindrop function).
Draw Dirichlet's Function
Generate a Dirichlet's function.