How to Play Lights Out — GF(2) Algorithm + Chase Technique

How to Play Lights Out — GF(2) Algorithm + Chase Technique

Lights Out was released by Tiger Electronics in 1995. The format: a grid of cells (5×5 standard); each cell is either ON or OFF. Press a cell to toggle it and its 4 neighbors (up, down, left, right). Goal: turn all cells OFF. It’s pure linear algebra disguised as a puzzle. Here’s how to play Lights Out, step by step.

Key takeaways

  • Pressing a cell twice undoes it, and the order of presses never matters.
  • “Chasing the lights” row by row clears everything except the bottom row.
  • On 5×5, a short lookup table tells you which top-row cells to press to finish the job.
  • On 4×4, a plain chase always finishes any solvable board.

The rules in 30 seconds

  • The board starts with some lights on.
  • Clicking a cell flips it and the cells directly above, below, left and right of it. Edge and corner cells have fewer neighbors, so they flip fewer lights.
  • Diagonal cells are never affected.
  • You win when every light is off. Fewer presses is better.

That’s the whole game. The challenge is that every press also disturbs lights you may already have switched off, so random clicking rarely works for long. You can try it now on our free Lights Out board while you read.

The math: GF(2) linear algebra

Each cell is either pressed or not — pressing it twice is the same as not pressing it at all, and the order of presses doesn’t matter. Each cell’s final state depends only on whether it and its neighbors were pressed an odd or even number of times. The whole puzzle is a linear system over GF(2) (the field with 2 elements: 0 and 1).

This means there’s an algorithmic solution. Gauss-Jordan elimination over GF(2) finds a set of cells that solves the board, or proves that none exists. The hint button in our game solves the current board and highlights one cell from the shortest solution, so following the hints clears the board in the minimum number of presses.

Technique 1: Chase the lights

Start with the top row. For every light that is on in row 1, press the cell directly below it in row 2. Pressing a cell toggles the cell above it, so this switches off every light in row 1.

Now do the same for row 2: for each light still on, press the cell below it in row 3. Continue down. After processing row 4, rows 1–4 are dark, but you may have lights stuck on row 5.

If the bottom row has ‘on’ cells after the chase, go to technique 2.

Technique 2: The top-row dispatch

On a 5×5 board, after chasing, the bottom row is one of 32 possible patterns (2^5). Only 8 of them can come from a solvable board; the other 24 mean the starting position had no solution.

Look up the bottom-row pattern in the table below (1 = light on, left to right). Press the matching cells in the TOP row, then chase down again; the entire grid should end up off.

Bottom row after chase Press in top row
1 0 0 0 1 1 1 0 0 0
0 1 0 1 0 1 0 0 1 0
1 1 1 0 0 0 1 0 0 0
0 0 1 1 1 0 0 0 1 0
1 0 1 1 0 0 0 0 0 1
0 1 1 0 1 1 0 0 0 0
1 1 0 1 1 0 0 1 0 0

This dispatch table is short enough to memorize, and it’s the standard way people solve 5×5 boards by hand. Each pattern has other top-row presses that work too; the table lists one of the shortest.

A memory aid: the table comes in mirror pairs. 1 1 1 0 0 (press the second cell) mirrors 0 0 1 1 1 (press the fourth cell), and 1 0 1 1 0 (press the fifth) mirrors 0 1 1 0 1 (press the first).

A worked example

Say you finish the first chase on a 5×5 board and the bottom row reads 1 1 0 1 1: the two outer pairs are lit and the middle is dark. The table says to press only the middle cell of the top row (0 0 1 0 0).

That press lights up three cells in the top row and one below it. Now chase again from the top exactly as before. The new lights travel down the board as you chase them, and when you reach the bottom this time the whole board goes dark. If it doesn’t, you most likely missed a light during one of the chases, so go back to the top and repeat.

Technique 3: The ‘parity’ check

Not every arrangement of lights can be switched off. On the 5×5 board only one in four possible starting patterns is solvable, and each solvable board has exactly four different press sets that solve it.

Board size matters. On 3×3, 6×6 and 7×7 boards every pattern is solvable and the solution is unique. On 4×4, only one in sixteen patterns is solvable. In our game you never have to worry about this: each puzzle is created by pressing random cells on a dark board, so it can always be solved.

Technique 4: Solve smaller before larger

Beginners should start at 3×3 Lights Out. There are 9 cells and 2^9 = 512 possible combinations of presses, and every starting pattern has exactly one of them as its solution. It’s the ideal board to get the hang of the chase technique.

Move to 4×4, then 5×5 (the classic). Bigger boards take longer chases, and on 5×5 you’ll need the dispatch table above to finish the bottom row.

Lights out solutions for other board sizes

The chase works on every board size; only the finishing step changes.

3×3: after the chase, use this table, then chase again.

Bottom row after chase Press in top row
0 1 1 1 0 0
1 1 0 0 0 1
1 1 1 0 1 0
1 0 0 1 1 0
0 0 1 0 1 1
1 0 1 1 0 1
0 1 0 1 1 1

4×4: no table needed. On a 4×4 board, any position that can be solved at all is cleared by a single top-to-bottom chase, so if lights remain on the bottom row, recheck your chase.

6×6 and 7×7: every board has exactly one solution, but the lookup tables are too long to memorize (64 and 128 bottom-row patterns). The practical approach is to chase, note the bottom row, then experiment with top-row presses and chase again, or press Hint to get one cell of the solution.

Technique 5: The ‘inversion’ check

Once you have a solution, you can verify it by simulating. Press each cell in your solution; do they ALL go off? If yes, you’ve found a valid solution.

Multiple solutions can exist for the same starting position (on 5×5 there are always four). The ‘minimum’ solution (fewest presses) is the canonical answer.

Practice

Play our Lights Out, with board sizes from 3×3 through 7×7, an undo button, and a hint button that points at a press from the shortest solution of the current board. If you like this kind of logic puzzle, our guide on how to solve the 15 puzzle is a good next step, and the Chrome Dino game is there when you need a break from thinking.

The counters help you improve. “Min” shows the fewest presses that can solve the current puzzle, “Moves” counts yours, and “Best” remembers your lowest winning move count for each board size in your browser. Try to match Min: it forces you to spot the shortcuts the plain chase method misses.

For more puzzles with a method behind them, try Picross with our Picross guide, read how to solve the Tower of Hanoi, or browse the best browser logic games. The Wikipedia article on Lights Out covers the original handheld and the math in more depth.

Frequently asked questions

Is every Lights Out puzzle solvable?

Not in general. On a 5×5 board only one in four random patterns can be solved, and on 4×4 only one in sixteen. Every puzzle in our game is solvable, because each one is built by pressing cells on a dark board.

What is the fastest way to solve Lights Out?

Chase the lights down the board row by row, then use the top-row lookup table for the bottom row and chase once more. With practice, this solves any 5×5 board without guessing.

Does the order of presses matter in Lights Out?

No. Each press flips the same five cells (or fewer at an edge) no matter when you make it, so only which cells you press matters. Pressing the same cell twice cancels out.

How many moves does it take to solve Lights Out?

It depends on the puzzle. Our game shows the minimum for each board in the “Min” counter. A full chase usually takes more presses than that, because it doesn’t look for the shortest of the possible solutions.

What does the Hint button do?

It solves the current board with a GF(2) solver and highlights one cell that belongs to a valid solution. Press it, then carry on yourself or ask for the next hint.

Related reading

🔌 Connect any AI assistant to dinogame.gg — we run an MCP server: https://dinogame.gg/mcp