Skip to main content

Puzzle Solver

Lights Out Solver

Build any 2×2 to 5×5 Lights Out board, toggle cells, and get the exact optimal move sequence using Gaussian elimination over GF(2).

Classic grid puzzle

Light Out Solver

Build any 2x2 to 5x5 Light Out puzzle, switch between linked play and manual edit mode, then solve it with the same optimal Gaussian-elimination logic from the original project.

Interactive board

Tap any bulb to toggle it and its neighbors together.

5 x 5

Build a puzzle or randomize one, then solve it.

Solution steps

Solve a board to see the guided move path.

Lights out puzzle solver, explained

Stuck on a 5x5 grid where every press lights more tiles than it clears? This lights out solver reads your board and returns the exact press set that turns every light out. As a lights out puzzle solver it also flags dead boards, so enter the lit tiles and press the set in any order.

Two facts about Lights Out that change how you see it

Fact one: pressing a tile twice cancels out. Whatever the first press did, the second undoes it. So no useful solution ever presses the same tile twice, and a solution is not a sequence at all. It is a set of tiles.

Fact two: order does not matter. Toggle operations commute; pressing tile A then tile B lands the board in exactly the same state as B then A. Together the two facts mean every board is really asking one question: which subset of tiles, pressed once each, turns everything off?

That is why the game feels different from every other puzzle on this site. There is no feedback loop and no partial credit. The answer exists or it does not, and once you know the set, nothing can go wrong executing it. The result is oddly calming, a stillness that holds even on a stubborn board.

The consequence worth memorizing

A Lights Out solution is a set, not a sequence. Press the tiles in any order. The board cannot tell the difference.

How this lights out solver computes the press set

Under the hood, this is the cleanest math on the site. Each light contributes one equation: "the number of presses among this light and its neighbors, counted modulo two, must equal its current state." On or off, one or zero: the entire puzzle lives in a number system with two elements.

Stack all those equations and you get a linear system, and the solver runs Gaussian elimination on it, adapted for that two-value arithmetic. The output is a provably correct press set: if it says press these tiles, pressing exactly those clears every light, on any board size, computed in milliseconds.

What makes it trustworthy, and the reason it never "fails" the way hint systems do, is that there is no heuristic anywhere in it. It is not pattern-matching against known boards or guessing promising regions. It is the same elimination you would do by hand with unlimited patience, done instantly, and provably minimal in structure.

Chasing the lights: the manual method

You do not need linear algebra at the table. The classic manual strategy is called chasing, and it works on every solvable board: start at the top row, and for each light that is on, press the tile directly below it. That row is now dark. Move down a row and repeat, pushing the surviving lights downward until only the bottom row can be lit.

The bottom row is where the chase either finishes or stalls, and here is the trick: the pattern of lights remaining in that bottom row tells you exactly which tiles to press in the top row. Run the chase again with those top-row presses in place, and the whole board goes dark. The mapping from bottom-row patterns to top-row presses is fixed for each board size, and for a 5×5 the common ones are worth memorizing.

Geometry matters while you chase: a center press flips five tiles and an edge press flips four. A corner press flips three. Corners are the easiest tiles to reason about and the cheapest to fix. When you are stuck mid-chase, re-verify the corners first, because they are the tiles the eye most often skips.

The chase, in four moves

  • Top row: press the tile below every light that is on
  • Move down one row and repeat, pushing lights toward the floor
  • Reach the bottom row and read its remaining light pattern
  • Press the corresponding top-row tiles, chase down once more, done

One solution, several solutions, or none at all

Some boards have a unique press set. Some have several equally valid ones, related by what players call quiet patterns, small sets of presses that cancel out entirely, like the all-on row pattern, which you can add to any solution to get another solution with the same result. If you use the solver and get a different press set than another player did, you can both be right.

And some boards have no solution at all. On classic 5×5 grids only a fraction of configurations are solvable. The solver detects these directly: the elimination has no consistent answer, and it tells you so instead of inventing one.

No-solution detection is the single most valuable feature here. Without it, every failure looks like player error, inviting random tile presses for minutes on end. Knowing that some states are mathematically dead ends is not defeatism. It is the difference between searching and thrashing.

Board sizes: what changes and what does not

The solver handles everything from 3×3 minis to the classic 5×5 and larger custom layouts, because the elimination just scales: bigger board, bigger system, same two-value arithmetic, same exact answer.

What changes by hand is the feel. Small boards have few possible states and can seem random, almost scrambly; the 5×5 has enough structure for the chase to feel like a method rather than a shuffle. The bottom-row mapping differs per size, so a memorized 5×5 table is useless on a 4×4. The first few runs on any new size should go through the solver until the table is committed to memory.

If you are learning, start at 3×3 deliberately: the chase is short enough to hold in your head, and every concept (sets, quiet patterns, dead ends) shows up in miniature. The recommended path for anyone coming to the math late: small board first and math second.

Where you will actually meet this puzzle

Lights Out lives everywhere except the front of the shelf: as a minigame inside larger games, in puzzle collections, in speedrun categories, and in math classrooms as the friendliest possible introduction to linear algebra over finite fields. Every one of those settings is a good reason to have a solver bookmarked.

The classroom use is a strong one. Set up a board, solve it by hand with the chase, then run the solver and compare: the press set is a worked solution to a real linear system, and seeing elimination produce a set of tiles you can physically press makes the abstraction land in a way textbook exercises rarely do.

The speedrun angle is real: knowing the exact press set ahead of time turns the run into motion practice instead of problem-solving. Whether that fits the spirit of the category is a separate question. The math does not judge.

Ask the lights out puzzle solver

How does the Lights Out solver work?

It turns every light into an equation over a two-value system (on or off) and solves the whole stack with Gaussian elimination. The output is the exact set of tiles to press, provably correct on any solvable board.

Does the order of presses matter in Lights Out?

No. Pressing a tile twice cancels out, so a solution is a set of tiles rather than a sequence. Any order clears the board equally well.

Can every Lights Out board be solved?

No. Some configurations are mathematically dead ends, and on classic boards only a fraction of states are solvable. The solver detects these and says so instead of pressing forever.

What is the chase method for turning every light out?

The standard by-hand solve: work top to bottom, pressing below each lit tile to push the lights down, then read the bottom row's pattern to determine your top-row presses. One more chase and the board is dark.

Does this lights out puzzle solver handle every board size?

Yes. The same elimination scales from 3×3 minis to 5×5 classics and larger custom grids. Only the memorized bottom-row mappings differ by size.

More WordSolverX tools

Photo of Preston Hayes

Credited editor

Preston Hayes

Preston Hayes is the credited editor for WordSolverX answer pages and puzzle strategy content. His work focuses on clear answer presentation, source verification, solver guidance, and fast corrections when a game changes.