Skip to content
EN

Solving the fifteen puzzle, row by row

There is a method that works on every solvable board, from 3×3 to 5×5. It is not the shortest route, but it never gets lost.

Peel the board in layers

Solve the top row first, then the left column. What remains is the same puzzle one size smaller and you never need to touch the finished tiles again. On a 4×4 board one layer leaves a 3×3 corner; on 5×5 you peel two layers.

Move each tile in short laps. To bring a tile up or left, take the gap around it, never through the tiles you have already placed.

The last two tiles of a line

Placing a row's last two tiles one at a time does not work: putting in the final tile knocks out the one before it. Instead place them as a pair. For the top row of a 4×4 board, put tile 3 into the corner where tile 4 belongs, then bring tile 4 directly underneath it. With the gap just left of tile 3, slide tile 3 left and tile 4 up: both are home.

The left column works the same way turned on its side: put the upper of the two tiles into the bottom cell where the lower one belongs, bring the lower tile right beside it, then, with the gap just above, slide the first tile up and the second one left.

Finishing the 3×3 corner

The final 3×3 corner is small enough to solve by feel. Bring the tiles round the ring of eight cells in the right cyclic order, then let the last moves drop them into place. If two tiles end up swapped, the position is not lost: send them round the ring once more.

On the easy 3×3 boards we also give the exact shortest solution for each numbered puzzle. Comparing your move count with it is a good way to sharpen your feel for short cycles.

Why half of all shuffles are impossible

Each slide swaps the gap with one tile, and that changes the parity of the arrangement in a fixed way. Count the pairs of tiles that are in the wrong order. On a board with an odd width that count must be even for the board to be solvable. On an even width, add the gap's row counted from the bottom: the total must be odd. If you lift two tiles out and swap them, you flip the parity and the board can no longer be solved. That is why the old 14–15 challenge, a finished board with just those two tiles swapped, has no solution at all.

Every board on this site is checked for parity before it is shown, so if you are stuck, it is not the board.

Practice

Start with the easy 3×3 set, then the short 4×4 shuffles, where tiles stay close to home.