How to play
The grid opens with some squares lit and the rest dark. Pressing a square flips it, and it also flips the squares immediately above, below, to the left and to the right of it — the diagonals are never touched. A press in the middle of the board therefore changes five squares, a press on an edge changes four, and a press in a corner changes three. The board is finished when every square is dark at the same time. There is no clock counting against you and no limit on presses, so you can sit with a position for as long as you like.
Four numbers sit above the grid. Clicks counts the presses you have made on the current board. Lights on is how many squares are still lit, which is useful mostly as a sanity check, because it can rise as well as fall on the way to a solution. Shortest is the smallest number of presses that would have cleared the board as it was dealt; it is calculated when the board appears, not guessed. Best is the fewest presses you have ever used to clear a board of that size, kept in your own browser and nowhere else.
Three sizes are offered. The three by three grid is small enough to hold in your head and is the place to meet the mechanics. The five by five is the classic shape. The seven by seven is no harder to understand, only longer, and the method described below stops being optional there.
Controls
- Click or tap a square to press it.
- Arrow keys move between squares, and Enter or Space presses the square you are on. Home and End jump to the start and end of the row you are in.
- Restart this board puts the same scramble back and resets your click count, which is what you want when a board has gone sideways and you would like a clean attempt at it.
- Give up and show a solution marks the squares that clear the board from wherever you currently are. That board will not be recorded as a best, for obvious reasons.
- New board deals a fresh scramble at the current size.
Why the order of your presses never matters
This is the most useful thing to know about the puzzle, and it is easy to prove to yourself. Press any square twice in a row and the board returns to exactly the state it was in beforehand: the first press flipped five squares, the second flipped the same five back.
The consequence reaches further than it first appears. If pressing a square twice does nothing, then only one thing matters about each square — whether you pressed it an odd number of times or an even number of times. Three presses are the same as one; four are the same as none. A solution is therefore not a sequence of moves at all. It is a set of squares needing an odd number of presses, which you can work through in any order. There is no way to spoil a board by playing the right presses in the wrong order, and no such thing as being trapped: whatever mess you have made was itself produced by some set of presses, and repeating that set undoes it.
Chasing the lights
The standard method follows directly from that, and it turns a grid-wide problem into a much smaller one. Work down the board one row at a time. For every lit square in the top row, press the square directly beneath it. The whole top row then goes dark, because the only presses that can affect a square in the top row are presses in that row and presses directly below it. Repeat with the second row, pressing squares in the third to clear it, and so on to the bottom. When you reach the end, every row is dark except possibly the last one.
What is left in that bottom row is the whole puzzle, compressed. The pattern sitting there tells you which squares in the top row you should have pressed at the very beginning. Press some set of squares in the top row, chase all the way down again, and the board clears. On a five by five grid there are only thirty-two possible sets of top-row presses, so even brute force works: try one, chase, and if the bottom row is not empty, restart and try the next. Players who do this often end up memorising the handful of bottom-row patterns that actually occur and what each of them requires up top.
Quiet patterns, and why the five by five is special
On a five by five grid there exist sets of squares that, pressed together, change absolutely nothing: every flip is cancelled by another flip inside the same set. Two independent sets like this exist, which combine into four including the empty one. First consequence: a board that can be cleared can be cleared in exactly four ways, since adding a quiet set to a working solution leaves it working. Second, and less comfortably, only one arrangement of lights in four can be cleared at all on a five by five grid. The other three quarters are dead ends from the moment they appear.
That is why the boards here are built the way they are. Rather than switching lights on at random and hoping, the page starts from a completely dark grid and presses squares at random, so the presses that made the pattern will also unmake it. Solvability is guaranteed by construction rather than by testing.
The three by three and seven by seven grids have no quiet patterns at all. Every one of their possible arrangements can be cleared, and each one has exactly one solution. The Shortest figure comes from solving the grid as a system of equations in which each square is either flipped or not, then comparing the solutions the board allows and keeping the smallest. On a fully lit five by five board that number is fifteen.
Timings we saw solving these boards ourselves, so read them as estimates, not targets: a three by three board usually falls in well under a minute once the flip pattern is familiar, a five by five takes most people three to eight minutes on the first few attempts and far less once chasing becomes automatic, and a seven by seven runs to ten minutes or more because of the length of the chase rather than any extra difficulty. Matching the Shortest figure on a seven by seven is genuinely hard.
Where the puzzle came from
Lights Out was released as a handheld electronic toy by Tiger Electronics in 1995, with a five by five arrangement of lit buttons and the same flipping rule used here. Mathematicians took an interest almost immediately, for the reason described above: each square has two states and the order of moves is irrelevant, which puts the whole puzzle within reach of ordinary linear algebra done with even and odd numbers instead of the usual arithmetic. The version on this page is our own implementation, and the boards it deals are generated fresh each time rather than drawn from a fixed list.
Questions players ask
Can a board here turn out to be impossible?
No. Boards are scrambled from a dark grid by pressing squares at random, so the presses that created the pattern will always undo it. This matters most on the five by five board, where only a quarter of all conceivable arrangements can be cleared.
Does the order I press the squares in change anything?
No. Pressing a square twice restores the board exactly, so only the parity of each square matters. A solution is a set of squares rather than a sequence.
What does the Shortest number mean?
It is the fewest presses that clear the board you were dealt, worked out by solving the grid as a system of two-state equations and comparing every solution it admits.
Why can two different sets of presses both clear a five by five board?
Because some sets of squares on that grid cancel out entirely and leave the board unchanged. Adding one to a working solution produces another working solution, so there are always four. The three by three and seven by seven grids have no such sets, and their solution is unique.