Cellular Automaton Simulator - Game of Life & Elementary CA

Elementary Cellular Automaton Simulator & Complete Rule Table - All 256 Rules

The simplest type of cellular automaton: each cell has two states (0/1), and the next state is determined by the cell and its two neighbors (3 cells total). Formally known as an Elementary Cellular Automaton (ECA). There are exactly 256 rules. Notable examples include Rule 110, which has been proven Turing complete, and Rule 30, known for its chaotic patterns. Enter a rule number in the simulator to see it in action, and use the table below to compare all rules at a glance.

Null rule — all cells die

Initial state

Rule table
Current 3 cells111110101100011010001000
Next generation00000000

Rules

An elementary cellular automaton works in the following steps:

  1. Start with a row of cells as the initial state. Each cell holds a state of 0 (dead) or 1 (alive). The cells at each end wrap around to the opposite side, forming a ring (periodic boundary conditions)
  2. For each cell, look at the 3-cell neighborhood: its left neighbor, itself, and its right neighbor
  3. Look up the 3-cell combination in the rule table (a lookup table that defines the next value for each combination) to determine that cell's value in the next generation
  4. Update all cells simultaneously to produce the next generation (compute the next value for every cell first, then replace them all at once)
  5. Repeat steps 2–4 to advance through generations. In this simulator, each generation is drawn as one row from top to bottom

How rule numbers work

There are 2³ = 8 possible 3-cell combinations (111 through 000), and a rule is a lookup table that specifies the next-generation value (0 or 1) for each. For example, Rule 110:

Current 3 cells111110101100011010001000
Next generation01101110

The 8 outputs lined up give 01101110₂, which converts to 110₁₀ in decimal — this becomes the rule number. There are 2⁸ = 256 possible rules in total

Step-by-step example

1. Prepare the initial state

  A row of cells, each holding 0 or 1.

  Gen 0: [0] [0] [1] [0] [0]
2. Look at each cell's neighborhood

  For each cell, look at left, center, and right as a set.
  The cells at each end wrap around to the opposite side, forming a ring (periodic boundary conditions).

       left center right
          ↓    ↓    ↓
  [0]  [0]  [1]  [0]  [0]
3. Look up the next state in the rule table

  Match the 3-cell combination against the rule table to get the next value.

  e.g. Rule 110:
  (0,1,0) → rule table lookup → 1
4. Update all cells simultaneously

  Apply the rule to every cell at once to produce the next generation.

  e.g. Rule 110:
  Gen 0: [0] [0] [1] [0] [0]
                ↓ all cells update at once
  Gen 1: [0] [1] [1] [0] [0]
5. Repeat

  Repeat 2→3→4 to advance through generations. Stacking them vertically creates a 2D pattern.

What is an Elementary Cellular Automaton?

Elementary Cellular Automata (ECA) were systematically studied by Stephen Wolfram in the 1980s and represent the simplest form of cellular automaton. Wolfram classified cellular automaton behaviors into four classes: Class 1 (uniform), Class 2 (periodic), Class 3 (chaotic), and Class 4 (complex). Classes 1 and 2 are orderly, Class 3 is chaotic, and Class 4 sits at the boundary between order and chaos.

Among the 256 rules, several are well known: Rule 30 is used for random number generation, Rule 110 has been proven Turing complete, Rule 90 generates the Sierpinski triangle, and Rule 184 models traffic flow.

Learn more about the history and applications of cellular automata

Chaos and Complexity

Of the four classes described above, Class 3 (chaotic) and Class 4 (complex) are the most noteworthy.

Class 3 — Chaos
Produces aperiodic, random-looking patterns. Rule 30 is famously used in Mathematica's random number generator, and its equivalents — Rule 86 (mirror), Rule 135 (reverse+flip), and Rule 149 (mirror + reverse+flip) — share the same chaotic structure. Rules 45 and 106 are also chaotic, each with their own equivalents (Rule 45 → 75, 89, 101; Rule 106 → 120, 169, 225).
Class 4 — Complexity
Sits at the boundary between orderly Classes 1–2 and chaotic Class 3. Neither fully regular nor fully random, these rules produce "gliders" — moving local structures that emerge naturally and interact through collisions. This is what makes them capable of computation, as explained below.

Turing Completeness

Turing completeness means the ability to perform any computation given the right initial conditions. Class 4 (complex) is neither too orderly nor too chaotic, which makes this possible. In orderly rules, information becomes fixed; in chaotic rules, information disperses and is lost. In Class 4, gliders can preserve and transmit information, enabling computation.

Rule 110
Proven Turing complete by Matthew Cook in 2004, demonstrating that this simple rule can simulate any computation. Computation is achieved through collisions and interactions of moving local structures called gliders. Its equivalents — Rule 124 (mirror), Rule 137 (reverse+flip), and Rule 193 (mirror + reverse+flip) — are all Turing complete as well.
Rule 54
Conjectured to be Turing complete, but not yet proven. Like Rule 110, it produces gliders. From a single-cell initial condition, it produces left-right symmetric output. Since its mirror (explained below) is Rule 54 itself, its only equivalent is Rule 147 (reverse+flip).

Sierpinski Triangle

One of the most famous patterns in ECA is the Sierpinski triangle (Sierpinski gasket). Starting from a single ON cell, a self-similar fractal triangle emerges.

Exact Sierpinski triangle
Rules 18, 90, and 146 produce symmetric Sierpinski triangles. Rule 60 produces a right-leaning triangle, and Rule 102 produces a left-leaning triangle (these two are mirror equivalents).
Sierpinski from single cell only
Rules 26, 154, 210, and 218 produce a Sierpinski triangle from a single-cell initial condition, but exhibit different behavior with random initial conditions.
Sierpinski-like fractals
Rules 22, 122, and 126 produce fractal patterns that resemble the Sierpinski triangle but are not strictly identical to it.
Color-Inverted Sierpinski
Rules 60, 90, and 102 — which generate Sierpinski patterns — are palindrome rules (explained below), and their equivalents Rules 195, 165, and 153 produce color-inverted Sierpinski patterns. Likewise, Rule 126 (Sierpinski-like) is a palindrome rule, and its equivalent Rule 129 produces an inverted Sierpinski-like fractal.
Other Equivalent Sierpinski Rules
Rule 183 (reverse+flip of Rule 18) and Rule 182 (reverse+flip of Rule 146) also produce equivalent Sierpinski patterns.

Traffic Model

Rule 184 is a particle-conserving rule used for traffic flow simulation. Treating black cells as cars and white cells as empty space, a car advances one cell if the space ahead is empty, and stops if blocked. Its equivalent Rule 226 (mirror) models traffic in the opposite direction.

What are Equivalent Rules?

Among the 256 rules, there are "equivalent rules" that generate patterns with the same structure. Equivalent rules are related by the following three transformations:

Mirror
Swaps the left cell (p) and right cell (r) in each neighborhood pattern. For example, 110 (left=1, center=1, right=0) becomes 011 (left=0, center=1, right=1). Symmetric patterns (111, 101, 010, 000) are unchanged. This results in swapping the values at bit positions 6↔3 and 4↔1, producing a left-right mirrored output from the same initial condition. When a rule produces symmetric output from a single cell (e.g., Rules 26 and 82, Rules 30 and 86), mirroring looks identical, so use random initial conditions to see the difference.
reverse+flip
Reverses the bit order, then flips each bit (0↔1). When the initial condition is also color-inverted, the output becomes the color-inverted version of the original pattern. However, some non-palindrome pairs such as Rule 110 and Rule 137 produce color-inverted patterns even from the same single-cell initial condition.
Mirror + reverse+flip
Combines the two transformations above. First swaps left and right cells in each neighborhood pattern, then reverses the bit order and flips each bit.

Note Mirror and the "reverse" in reverse+flip are different operations. Mirror swaps the left and right cells in each neighborhood pattern (swapping bit positions 6↔3 and 4↔1), while reverse reverses the entire bit string order.

Palindrome Rules — A Special Case from Symmetry

When a rule's bit string is a palindrome (reads the same forwards and backwards), 255-R (simply flipping each bit) produces an equivalent rule. For example, Rule 90 (01011010) is a palindrome, so 255-R gives the equivalent Rule 165 (10100101). For palindrome rules, reverse+flip also gives the same result as bit-flip, since reversing a palindrome changes nothing.

All 256 Rules — Output Mapping Table

Complete output mapping for all 256 ECA rules
Rule111110101100011010001000Notes
000000000Null rule — all cells die
100000001
200000010
300000011
400000100
500000101
600000110
700000111
800001000
900001001
1000001010
1100001011
1200001100
1300001101
1400001110
1500001111
1600010000
1700010001
1800010010Sierpinski triangle
1900010011
2000010100
2100010101
2200010110Sierpinski-like fractal
2300010111
2400011000
2500011001
2600011010Sierpinski from single cell — differs from true Sierpinski with random input
2700011011
2800011100
2900011101
3000011110Chaotic (Class 3) — used in Mathematica RNG
3100011111
3200100000
3300100001
3400100010
3500100011
3600100100
3700100101
3800100110
3900100111
4000101000
4100101001Equivalent to Rule 107 (reverse+flip)
4200101010
4300101011
4400101100
4500101101Chaotic (Class 3)
4600101110
4700101111
4800110000
4900110001
5000110010Class II — periodic alternating pattern
5100110011
5200110100
5300110101
5400110110Complex (Class 4) — universality candidate
5500110111
5600111000
5700111001Class II — complex regular pattern
5800111010
5900111011
6000111100Sierpinski triangle (leans right) — additive rule
6100111101
6200111110Class II — glider interactions, eventually periodic
6300111111
6401000000
6501000001
6601000010
6701000011
6801000100
6901000101
7001000110
7101000111
7201001000
7301001001Locally chaotic (Li-Packard)
7401001010
7501001011Equivalent to Rule 45 (reverse+flip)
7601001100
7701001101
7801001110
7901001111
8001010000
8101010001
8201010010Equivalent to Rule 26 (mirror)
8301010011
8401010100
8501010101
8601010110Equivalent to Rule 30 (mirror)
8701010111
8801011000
8901011001Equivalent to Rule 45 (mirror + reverse+flip)
9001011010Sierpinski triangle
9101011011
9201011100
9301011101
9401011110
9501011111
9601100000
9701100001Equivalent to Rule 107 (mirror + reverse+flip)
9801100010
9901100011Equivalent to Rule 57 (mirror)
10001100100
10101100101Equivalent to Rule 45 (mirror)
10201100110Equivalent to Rule 60 (mirror) — Sierpinski triangle (leans left)
10301100111
10401101000
10501101001XNOR rule — NOT(p XOR q XOR r)
10601101010Class III — chaotic, (p AND q) XOR r
10701101011Class II — similar to Rule 106 but 000→1
10801101100
10901101101Class II — amphichiral (symmetric output) (symmetric output), reverse+flip of Rule 73
11001101110Turing complete (Class 4)
11101101111
11201110000
11301110001
11401110010
11501110011
11601110100
11701110101
11801110110Equivalent to Rule 62 (mirror)
11901110111
12001111000Equivalent to Rule 106 (mirror)
12101111001Equivalent to Rule 107 (mirror)
12201111010Near-Sierpinski fractal — amphichiral (symmetric output)
12301111011
12401111100Equivalent to Rule 110 (mirror) — Turing complete
12501111101
12601111110Sierpinski-like fractal
12701111111
12810000000
12910000001Inverted Sierpinski-like fractal — reverse+flip of Rule 126
13010000010
13110000011Equivalent to Rule 62 (reverse+flip)
13210000100
13310000101
13410000110
13510000111Equivalent to Rule 30 (reverse+flip)
13610001000
13710001001Equivalent to Rule 110 (reverse+flip) — Turing complete
13810001010
13910001011
14010001100
14110001101
14210001110
14310001111
14410010000
14510010001Equivalent to Rule 62 (mirror + reverse+flip)
14610010010Sierpinski triangle
14710010011Equivalent to Rule 54 (reverse+flip)
14810010100
14910010101Equivalent to Rule 30 (mirror + reverse+flip)
15010010110Additive rule — fractal but not Sierpinski
15110010111Equivalent to Rule 22 (reverse+flip)
15210011000
15310011001Equivalent to Rule 102 (palindrome) — inverted Sierpinski
15410011010Sierpinski from single cell — differs from true Sierpinski with random input
15510011011
15610011100
15710011101
15810011110
15910011111
16010100000
16110100001Equivalent to Rule 122 (reverse+flip)
16210100010
16310100011
16410100100Equivalent to Rule 218 (reverse+flip)
16510100101Equivalent to Rule 90 (palindrome)
16610100110Equivalent to Rule 154 (reverse+flip)
16710100111Equivalent to Rule 26 (reverse+flip)
16810101000
16910101001Equivalent to Rule 106 (reverse+flip)
17010101010
17110101011
17210101100
17310101101
17410101110
17510101111
17610110000
17710110001
17810110010
17910110011Equivalent to Rule 50 (reverse+flip)
18010110100Equivalent to Rule 154 (mirror + reverse+flip)
18110110101Equivalent to Rule 26 (mirror + reverse+flip)
18210110110Equivalent to Rule 146 (reverse+flip)
18310110111Equivalent to Rule 18 (reverse+flip)
18410111000Traffic model — particle conservation
18510111001
18610111010
18710111011
18810111100
18910111101
19010111110
19110111111
19211000000
19311000001Equivalent to Rule 110 (mirror + reverse+flip) — Turing complete
19411000010
19511000011Equivalent to Rule 60 (palindrome) — inverted Sierpinski
19611000100
19711000101
19811000110
19911000111
20011001000
20111001001
20211001010
20311001011
20411001100
20511001101
20611001110
20711001111
20811010000
20911010001
21011010010Equivalent to Rule 154 (mirror) — Sierpinski from single cell, differs with random input
21111010011
21211010100
21311010101
21411010110
21511010111
21611011000
21711011001
21811011010Sierpinski from single cell — differs from true Sierpinski with random input
21911011011
22011011100
22111011101
22211011110
22311011111
22411100000
22511100001Equivalent to Rule 106 (mirror + reverse+flip)
22611100010Equivalent to Rule 184 (mirror)
22711100011
22811100100
22911100101
23011100110
23111100111
23211101000
23311101001
23411101010
23511101011
23611101100
23711101101
23811101110
23911101111
24011110000
24111110001
24211110010
24311110011
24411110100
24511110101
24611110110
24711110111
24811111000
24911111001
25011111010
25111111011
25211111100
25311111101
25411111110
25511111111Identity rule — all cells live

Related Tools & Games