Lights Out solver facts at a glance
The Lights Out solver handles square boards from 3x3 to 10x10 and always returns the fewest presses, because it checks every possible solution of the board (up to 256 of them, on 9x9). It is free, needs no account and runs in your browser.
| Board sizes | Square boards 3x3, 4x4, 5x5, 6x6, 7x7, 8x8, 9x9 and 10x10 (5x5 is the classic) |
|---|---|
| Press rule | A press switches the cell and its neighbors above, below, left and right |
| What you get | The fewest cells to press, each pressed once, in any order, with a step-by-step replay |
| Solutions checked | All of them: 4 on 5x5, 16 on 4x4, 256 on 9x9, exactly one on the other sizes |
| Unsolvable boards | Reported as unsolvable; on 5x5 only 1 in 4 light patterns can be solved |
| Share link | Copy board link reopens the board and its solution; the board lives in the link |
| Price and setup | Free, no account, no download; runs in your browser |
How to use the Lights Out solver
Pick a board size from 3x3 to 10x10, tap every cell that is lit in your puzzle, and press Solve: the ringed cells are the fewest presses that turn every light off. Press each ringed cell once in your game, in any order.
- Pick the board size. The classic puzzle is 5x5; the solver takes any square board from 3x3 to 10x10.
- Copy the lit cells. Tap each cell that is on in your puzzle. Here a tap switches only that one cell, so you can copy any pattern exactly.
- Press Solve. The cells to press get a ring. Press each ringed cell once in your game, in any order.
- Follow along step by step. Next and Back show the board after each press, and Play runs the presses one after another, so you can check your game against every step.
- Keep the answer. Copy all presses puts the list on your clipboard, and Copy board link saves a link that reopens this board with its solution.
Lights Out 3x3
Every 3x3 Lights Out board can be solved, and each one has exactly one solution, so the answer the solver shows is the only one. Over all 511 boards with at least one light on, it takes 4.5 presses on average. All nine lights on takes 5 presses: the four corners and the center. The hardest 3x3 board is an X, with the four corners and the center lit: it takes all 9 cells, each pressed once.
Check the 3x3 answer, press by press
Start with 111 / 111 / 111: 1 is on, 0 is off; slashes separate rows, top to bottom. Each press switches itself and its existing orthogonal neighbors, never diagonals or opposite edges. The table shows every intermediate board.
| Press | Board after this press |
|---|---|
| Start | 111 / 111 / 111 |
| Row 1, column 1 | 001 / 011 / 111 |
| Row 1, column 3 | 010 / 010 / 111 |
| Row 2, column 2 | 000 / 101 / 101 |
| Row 3, column 1 | 000 / 001 / 011 |
| Row 3, column 3 | 000 / 000 / 000 |
Checking all 512 subsets of the nine cells gives exactly one solution: these five presses. No subset of four or fewer works. Use the example button above for the interactive replay, or reopen this exact board.
Lights Out 5x5
On the classic 5x5 board only 1 in 4 light patterns can be solved: 8,388,608 of the 33,554,432 possible boards. Every board that can be solved has 4 solutions, and the solver shows the shortest. Across all of them, the fewest presses average 9.9, and no board needs more than 15: 7,350 boards need exactly 15, all lights on among them.
To check a 5x5 board by hand, count the lit cells in columns 1, 3 and 5 of rows 1, 2, 4 and 5, then the lit cells in rows 1, 3 and 5 of columns 1, 2, 4 and 5. The board can be solved only if both counts are even, so a single light in a corner has no solution.
The 5x5 Lights Out solution for all lights on
The classic start has all 25 lights on, and the fewest presses that switch them all off is 15. Counting rows from the top and columns from the left, press row 1: columns 2, 3 and 5; row 2: columns 2, 3 and 4; row 3: columns 3, 4 and 5; row 4: columns 1, 2, 4 and 5; row 5: columns 1 and 2. The mirror image of this pattern works too. Tap Classic 5×5 above to watch it step by step.
To find a solution without a solver, chase the lights, as the next section shows.
Chase the lights: solving 5x5 Lights Out by hand
To solve Lights Out by hand, chase the lights: press the cell below every lit cell, row by row, until only the bottom row is lit. Then press the top-row cells that the table below gives for that bottom row, and chase down once more. The board goes dark.
- Chase down. In row 2, press the cell under every lit cell of row 1. Do the same for rows 3, 4 and 5. Rows 1 to 4 are now dark.
- Read the bottom row. Note which of the five cells in row 5 are still lit, left to right.
- Press the top row. Find that bottom row in the table and press the listed cells in row 1.
- Chase down again. Repeat step 1. This time the bottom row clears as well.
| Bottom row still lit | Press in the top row | Top-row cells to press |
|---|---|---|
00111 | 00010 | column 4 |
01010 | 10010 | columns 1 and 4 |
01101 | 10000 | column 1 |
10001 | 11000 | columns 1 and 2 |
10110 | 00001 | column 5 |
11011 | 00100 | column 3 |
11100 | 01000 | column 2 |
Any bottom row that is not in the table, such as a single lit corner, means the board cannot be solved. Light chasing finishes every board that can be solved, but it often takes more presses than needed: some cells get pressed in both chases, and the result is not always the shortest of the four solutions a 5x5 board has. For the fewest presses, enter the same board in the solver above.
Lights Out puzzles in other games
Many video games hide a Lights Out puzzle: a grid of tiles, switches or runes where touching one flips it and the ones around it. Before you copy it here, press one tile in the middle of the grid and watch what changes.
- The tile and the four touching it flip: that is the classic rule. If the grid is square and 3x3 to 10x10, enter it here as it is.
- The goal is every light on, not off: tap the cells that are off instead of the ones that are on. The presses that switch those cells off are exactly the presses that switch every light on.
- A press flips a whole row and column, the diagonal neighbours, or wraps around the edges: that is a variant, and this solver gives wrong answers for it. The same goes for grids that are not square.
How the solver works
The solver uses Gaussian elimination over binary arithmetic (1 + 1 = 0), then checks every solution for the fewest presses. Pressing twice cancels out; order never matters. A solvable 5x5 board has 4 valid press sets, 4x4 has 16 and 9x9 has 256. Those are counts of all solutions, not counts of shortest solutions. The minimum is the smallest press count among them.
The unsolvable 5x5 example above is 10000 / 00000 / 00000 / 00000 / 00000. Its top-left light makes both parity counts odd. Elimination confirms an inconsistent system, so no press set can clear it; this is not a timeout.
Only the listed square sizes and classic two-state rule are supported. This exact solver has no timed search budget: it checks at most 256 solutions on these sizes. A browser error or interrupted run is not proof of no solution. Read the solver source; these examples were checked on .
Frequently asked questions
Why does the solver say my board cannot be solved?
On some sizes, only part of all light patterns can be switched off: 1 in 4 on a 5x5 board, 1 in 16 on 4x4 and 1 in 256 on 9x9. Every pattern can be solved on 3x3, 6x6, 7x7, 8x8 and 10x10. A puzzle from a game always has a solution, so this message almost always means one cell was copied wrong.
Can every 3x3 Lights Out puzzle be solved?
Yes. All 511 light patterns on a 3x3 board can be switched off, each by exactly one set of presses, and none needs more than 9. All lights on takes 5 presses: the four corners and the center.
Does the order of the presses matter?
No. Each cell ends up switched once for every press on it or next to it, whatever the order, so you can press the ringed cells in any order. The list goes row by row only to make it easy to follow.
Is it really the fewest presses?
Yes. The solver lists every solution of the board, which is at most 256 on these sizes, and picks the one with the fewest presses. On sizes with a single solution, that one is the answer.
Does it work with variants such as wrap-around edges or three-color lights?
No. It solves the classic rule: a press switches the cell and its up, down, left and right neighbours, with on and off as the only states and no wrap-around at the edges.
My game wants every light on. Can I still use the solver?
Yes. Tap the cells that are off instead of the ones that are on, and press Solve. Pressing the ringed cells in your game switches every light on, because the same presses that clear the unlit cells light up the whole board.
Is the Lights Out solver free?
Yes. It is free, with no account and no download, and it runs in your browser. A board link keeps the lights in the link itself.