Play the Light Toggle Puzzle online

Tap a light to flip it and its four neighbours, and turn every light off. Sizes 3 by 3 to 7 by 7, a daily puzzle and a fewest-moves solver.

How it works

  1. Pick a size in the menu, 3 by 3 to 7 by 7, or the daily puzzle
  2. Tap a light: it and the lights above, below, left and right of it flip
  3. Turn every light off in as few moves as you can; Show solution marks the lights to press

How to play the light toggle puzzle

To win at the light toggle puzzle, turn every light on the grid off. Tapping a light flips it and the lights directly above, below, left and right of it: lit becomes dark and dark becomes lit. A light in a corner has two neighbours and one on an edge has three, so a press there flips 3 or 4 lights in all, and a press in the middle flips 5. The classic light-toggling puzzle is 5 by 5, and this page also offers 3 by 3, 4 by 4, 6 by 6 and 7 by 7. Every puzzle here is made by starting with all lights off and pressing a random half of the cells, so it can always be solved. The order of presses does not matter, and pressing the same light twice cancels out, so a solution is simply a set of lights to press once each. The page counts your moves and shows the fewest possible next to them. The daily puzzle is a 5 by 5 board that is the same for everyone on the same date, and your daily streak is kept in this browser.

How the solution is found

Each light's final state depends only on whether it and its neighbours were pressed an odd or even number of times. That makes the puzzle a set of linear equations over the numbers 0 and 1, where adding is done modulo 2. Gaussian elimination solves them. The page runs this when you press Show solution, using the board as it is now, and marks the lights to press. Some boards have more than one solution. On a 5 by 5 grid there are 4 solutions to any solvable position, because 2 independent sets of presses, called quiet patterns, change nothing; the page checks all four and shows the one with the fewest presses. A 4 by 4 grid has 16 solutions per puzzle, while 3 by 3, 6 by 6 and 7 by 7 have exactly one. This comes from the linear algebra, as described by Anderson and Feil in their 1998 paper on solving this kind of light-switching puzzle with linear algebra. Note that on 4 by 4 and 5 by 5 only some of the starting patterns can be solved, which is why this page builds puzzles from presses instead of lighting cells at random.

Tips for solving it yourself

A method that works on every size is chasing the lights. Go row by row from the top: for each lit light in a row, press the light directly below it. After you finish, the whole grid except the bottom row is dark. The pattern left in the bottom row tells you which lights in the top row to press first; on 5 by 5 there are only a few patterns, and each one has a matching set of top-row presses. Press those, chase again, and the board clears. This is slower than the shortest solution but always works. To get the fewest moves, use Show solution on a copy of the puzzle, then try again from Restart and aim to match it. Using the solution marks that game as one that does not count for your best.

Controls and limits

Click or tap a light, or use Tab to reach the board, the arrow keys to move between lights and Enter or Space to press. A lit light is teal with a dark dot in the middle, so it can be told from a dark one without colour. Undo takes back the last press and can be used until the start. Restart in the menu returns to the starting pattern of the same puzzle, and New puzzle makes another. The clock starts on your first press and pauses while the tab is hidden. Your fewest moves for each size and your daily streak are saved in this browser. This page has no timer-based scoring, no online leaderboard and no custom board editor.

Frequently asked questions

How do you play the light toggle puzzle?

Tap a light to flip it and the lights directly above, below, left and right of it. Keep tapping until all 25 lights on the 5 by 5 board, or all of the lights on another size, are off. The order of presses does not matter.

Is every light toggle puzzle solvable?

Not on every board: on 5 by 5 only 1 in 4 of all patterns can be solved, and on 4 by 4 only 1 in 16. This page builds each puzzle by pressing cells from a dark board, so every puzzle here has a solution.

What is the fewest number of moves?

The page shows it beside your moves, for example 11 fewest. It is found by trying every solution of the equations (4 on a 5 by 5 board) and taking the one with the fewest presses. If you match it, the status line says so.

How do I solve the light toggle puzzle by hand?

Chase the lights: from the top row down, press the light below each lit light, until only the bottom row has lit lights. On a 5 by 5 board a short table maps each bottom-row pattern to the top-row presses to start with. Press those and chase again.

What is the daily puzzle?

A 5 by 5 board chosen from the date, so everyone playing on the same day gets the same one. Your daily streak counts consecutive days solved in this browser. A new puzzle appears at your own midnight.

Does using Show solution count?

You can still finish the puzzle, but a game where you showed the solution does not count for your best moves or your best time. It still counts as a win for the streak.