← Games

Game Hub Articles

All articles
Home › Articles
💡

How to solve Lights Out (and the maths behind it)

By Noam · 25 November 2026 · 6 min read

Lights Out is a grid of lights. Pressing a light switches it and its neighbours (above, below, left and right) between on and off. The goal is to turn every light off. It became popular as a handheld electronic game in the 1990s, and it hides some neat maths that makes it much easier to solve.

Two facts that change everything

Pressing a light twice does nothing. The second press undoes the first. So in any solution, each light is pressed either once or not at all.

Order doesn't matter. Every press just flips the same five lights no matter when you do it. Pressing A then B gives exactly the same result as B then A. So a solution is really just a set of squares to press, not a sequence.

These two facts mean you can stop worrying about "undoing" moves and think about which squares belong in your set.

The chase-the-lights method

  1. Look at the top row. For every light that is on in the top row, press the light directly below it in the second row. This turns off the top row.
  2. Now do the same for the second row: for every light still on, press the one below it in the third row.
  3. Keep going down the board, row by row. You'll end up with all rows off except, possibly, the bottom row.

If the bottom row is off too, you've won. If not, the pattern left on the bottom row tells you which squares to press in the top row before chasing again. Every board size has its own small table of bottom-row patterns and matching top-row presses. With a bit of practice you can work them out by experimenting: press a top-row light, chase all the way down, and see what bottom pattern it creates.

Why this works

Once the top row's presses are decided, every other press is forced: there's only one way to clear each row using the row below. So the whole puzzle comes down to choosing the top row. On a 5 by 5 board there are only 32 possible top rows, which is why the method always gets there.

The maths name for it

Mathematicians solve Lights Out with linear algebra over two numbers, 0 and 1, where 1 + 1 = 0 (two presses cancel). Each light becomes an equation and each button a variable. That sounds advanced, but it's the same idea as the chase method, written down in a way computers can solve instantly. It also proves that some starting patterns can never be solved, which is why puzzle makers generate boards by pressing random buttons on a dark board instead of switching random lights on.

Practise

In Lights Out on the Hub, the grid grows from 3 by 3 up to 5 by 5. Try the chase method on the small boards first and you'll find the bigger ones much less scary.

▶ Play Lights OutAll games

More articles

🪩 Pinball tips: how to trap the ball, aim your shots and score moreStop flailing at the flippers. Learn to catch the ball, aim with the flipper, pass it between flippers and use nudges, plus a bit of pinball history.🐍 Snake strategy: how to get a really long snakeHug the walls, sweep in zig-zags and never trap yourself. Simple strategies for the classic Snake game, plus where Snake came from.🎳 Bowling tips and how bowling scoring really worksWhy strikes and spares are worth extra, how a 300 game works, and where to aim to knock down all ten pins.🧱 Brick-breaking games: the story of Breakout and how to clear every levelHow a 1976 arcade game built by two future Apple founders created a whole genre, and how to control the ball's angle to clear bricks faster.🟦 Falling-block puzzle tips: keep your stack flat and clear more linesFlat stacks, a well for the long piece, using Hold and Next, and staying calm at high speed. How to get better at falling-block puzzles like Block Drop.