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. Despite having only 256 possible rules, their behavior is remarkably diverse. Wolfram classified this behavior into four classes.

Class 1 — Uniform
Regardless of initial conditions, all cells converge to the same state within a few generations. All information from the initial state is completely lost — the simplest possible behavior.
Class 2 — Periodic
Settles into stable patterns such as stripes or fixed points and repeats them indefinitely. Some influence from the initial conditions is preserved locally, but overall behavior remains predictably orderly.
Class 3 — Chaotic
Generates aperiodic, random-looking patterns indefinitely. Tiny differences in initial conditions lead to entirely different outcomes, making long-term prediction impossible. Yet because these patterns are generated by deterministic rules, they can be used as pseudorandom number generators.
Class 4 — Complex
Sits at the boundary between order (Classes 1–2) and chaos (Class 3). Information neither freezes as in Classes 1–2 nor disperses as in Class 3. In this delicate balance, "gliders" — structures that maintain their shape while moving — emerge spontaneously. Gliders can carry information, and their collisions produce new patterns. This ability to preserve, transmit, and transform information is what makes computation possible.

Among the 256 rules, several stand out: Rule 30 is used for chaotic random number generation, Rule 110 has been proven Turing complete, Rule 90 generates the Sierpinski triangle, and Rule 184 models traffic flow. Below, we explore these and other notable rules by class.

Learn more about the history and applications of cellular automata

Notable Class 1 & 2 Rules — Orderly

In Class 1, rules like Rule 0 (all cells converge to 0) and Rule 255 (all cells converge to 1) cause every cell to reach the same state within a few generations. Class 2, on the other hand, contains many interesting rules — including Sierpinski-family rules that generate fractal patterns and rules that simulate traffic flow.

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, 126, and 150 produce fractal patterns that resemble the Sierpinski triangle but are not strictly identical to it.

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.

Notable Class 3 Rules — Chaos

Produces aperiodic, random-looking patterns. Rule 30 is famously used in Mathematica's random number generator. Rules 45 and 106 also exhibit chaotic behavior.

Notable Class 4 Rules — Complexity

The "gliders" described above can be observed in action by running Class 4 rules in the simulator. In Rules 110 and 54, structures that maintain their shape emerge within the periodic background pattern, moving at different speeds. When gliders collide, they produce complex interactions — annihilation, merging, and splitting.

Class 4 Supplement — 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.
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.

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:

Left-right symmetry
Swapping the left and right cells in each neighborhood pattern (swap) produces a left-right symmetric pattern. When a rule produces symmetric output from a single cell (e.g., Rules 26 and 82, Rules 30 and 86), the transformation looks identical, so use random initial conditions to see the difference.
Black-white symmetry
Reversing the bit order and then flipping each bit (reverse+flip) produces a black-white symmetric pattern. This is different from a simple bit-flip (complement). When the initial condition is also color-inverted, the output becomes the color-inverted version of the original pattern. However, some pairs such as Rule 110 and Rule 137 produce color-inverted patterns even from the same single-cell initial condition.
Left-right + Black-white symmetry
Combines the two transformations above. First swaps left and right cells in each neighborhood pattern, then reverses the bit order and flips each bit.
Palindrome Rules — A Special Case from Symmetry
When a rule's bit string is a palindrome (reads the same forwards and backwards), flipping the input bits alone causes the output bits to flip as well. Normally, black-white symmetry requires reverse+flip (reversing the order then flipping), but for palindrome rules the bit string is unchanged when reversed, so flip alone is sufficient. The equivalent rule can be found by 255-R. For example, Rule 90 (01011010) is a palindrome, so 255 - 90 = Rule 165 (10100101) is its equivalent.

Note The swap in left-right symmetry swaps the left and right cells of each neighborhood pattern (3 bits). For example, neighborhood pattern 110 (position 6) becomes 011 (position 3) when left and right are swapped, so bit positions 6 and 3 are exchanged in the rule's bit string (8 bits). Similarly, 100 (position 4) and 001 (position 1) are exchanged. Symmetric patterns (111, 101, 010, 000) remain unchanged. For example, Rule 110 (01101110): bit positions 6 and 3 are both 1 (unchanged), while bit position 4 (0) and position 1 (1) are swapped, giving 01111100 = Rule 124.

All 256 Rules — Output Mapping Table

Complete output mapping for all 256 ECA rules
RuleClass111110101100011010001000Notes
0100000000Null rule — all cells die
100000001
200000010
300000011
400000100
500000101
600000110
700000111
800001000
900001001
1000001010
1100001011
1200001100
1300001101
1400001110
1500001111
1600010000
1700010001
18200010010Sierpinski triangle
1900010011
2000010100
2100010101
22200010110Sierpinski-like fractal
2300010111
2400011000
2500011001
26200011010Sierpinski from single cell — differs from true Sierpinski with random input
2700011011
2800011100
2900011101
30300011110Chaotic — used in Mathematica RNG
3100011111
3200100000
3300100001
3400100010
3500100011
3600100100
3700100101
3800100110
3900100111
4000101000
41200101001Equivalent to Rule 107 (black-white symmetry)
4200101010
4300101011
4400101100
45300101101Chaotic
4600101110
4700101111
4800110000
4900110001
50200110010Periodic alternating pattern
5100110011
5200110100
5300110101
54400110110Complex — universality candidate
5500110111
5600111000
57200111001Complex regular pattern
5800111010
5900111011
60200111100Sierpinski triangle (leans right) — additive rule
6100111101
62200111110Eventually periodic
6300111111
6401000000
6501000001
6601000010
6701000011
6801000100
6901000101
7001000110
7101000111
7201001000
73301001001Locally chaotic (Li-Packard)
7401001010
75301001011Equivalent to Rule 45 (black-white symmetry)
7601001100
7701001101
7801001110
7901001111
8001010000
8101010001
82201010010Equivalent to Rule 26 (left-right symmetry)
8301010011
8401010100
8501010101
86301010110Equivalent to Rule 30 (left-right symmetry)
8701010111
8801011000
89301011001Equivalent to Rule 45 (left-right + black-white symmetry)
90201011010Sierpinski triangle
9101011011
9201011100
9301011101
9401011110
9501011111
9601100000
97201100001Equivalent to Rule 107 (left-right + black-white symmetry)
9801100010
99201100011Equivalent to Rule 57 (left-right symmetry)
10001100100
101301100101Equivalent to Rule 45 (left-right symmetry)
102201100110Equivalent to Rule 60 (left-right symmetry) — Sierpinski triangle (leans left)
10301100111
10401101000
105201101001XNOR rule — NOT(p XOR q XOR r)
106301101010Chaotic, (p AND q) XOR r
107201101011Similar to Rule 106 but 000→1
10801101100
109201101101Amphichiral (symmetric output), black-white symmetry of Rule 73
110401101110Turing complete
11101101111
11201110000
11301110001
11401110010
11501110011
11601110100
11701110101
118201110110Equivalent to Rule 62 (left-right symmetry)
11901110111
120301111000Equivalent to Rule 106 (left-right symmetry)
121201111001Equivalent to Rule 107 (left-right symmetry)
122201111010Near-Sierpinski fractal — amphichiral (symmetric output)
12301111011
124401111100Equivalent to Rule 110 (left-right symmetry) — Turing complete
12501111101
126201111110Sierpinski-like fractal
12701111111
12810000000
129210000001Inverted Sierpinski-like fractal — black-white symmetry of Rule 126
13010000010
131210000011Equivalent to Rule 62 (black-white symmetry)
13210000100
13310000101
13410000110
135310000111Equivalent to Rule 30 (black-white symmetry)
13610001000
137410001001Equivalent to Rule 110 (black-white symmetry) — Turing complete
13810001010
13910001011
14010001100
14110001101
14210001110
14310001111
14410010000
145210010001Equivalent to Rule 62 (left-right + black-white symmetry)
146210010010Sierpinski triangle
147410010011Equivalent to Rule 54 (black-white symmetry)
14810010100
149310010101Equivalent to Rule 30 (left-right + black-white symmetry)
150210010110Additive rule — fractal but not Sierpinski
151210010111Equivalent to Rule 22 (black-white symmetry)
15210011000
153210011001Equivalent to Rule 102 (palindrome) — inverted Sierpinski
154210011010Sierpinski from single cell — differs from true Sierpinski with random input
15510011011
15610011100
15710011101
15810011110
15910011111
16010100000
161210100001Equivalent to Rule 122 (black-white symmetry)
16210100010
16310100011
164210100100Equivalent to Rule 218 (black-white symmetry)
165210100101Equivalent to Rule 90 (palindrome)
166210100110Equivalent to Rule 154 (black-white symmetry)
167210100111Equivalent to Rule 26 (black-white symmetry)
16810101000
169310101001Equivalent to Rule 106 (black-white symmetry)
17010101010
17110101011
17210101100
17310101101
17410101110
17510101111
17610110000
17710110001
17810110010
179210110011Equivalent to Rule 50 (black-white symmetry)
180210110100Equivalent to Rule 154 (left-right + black-white symmetry)
181210110101Equivalent to Rule 26 (left-right + black-white symmetry)
182210110110Equivalent to Rule 146 (black-white symmetry)
183210110111Equivalent to Rule 18 (black-white symmetry)
184210111000Traffic model — particle conservation
18510111001
18610111010
18710111011
18810111100
18910111101
19010111110
19110111111
19211000000
193411000001Equivalent to Rule 110 (left-right + black-white symmetry) — Turing complete
19411000010
195211000011Equivalent to Rule 60 (palindrome) — inverted Sierpinski
19611000100
19711000101
19811000110
19911000111
20011001000
20111001001
20211001010
20311001011
20411001100
20511001101
20611001110
20711001111
20811010000
20911010001
210211010010Equivalent to Rule 154 (left-right symmetry) — Sierpinski from single cell, differs with random input
21111010011
21211010100
21311010101
21411010110
21511010111
21611011000
21711011001
218211011010Sierpinski from single cell — differs from true Sierpinski with random input
21911011011
22011011100
22111011101
22211011110
22311011111
22411100000
225311100001Equivalent to Rule 106 (left-right + black-white symmetry)
226211100010Equivalent to Rule 184 (left-right symmetry)
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
255111111111Identity rule — all cells live

Related Tools & Games