How to Solve a Sliding Puzzle (15 Puzzle), Step by Step

Sam Loyd's classic 14-15 sliding puzzle illustration
Photo: “Sam Loyd - The 14-15 Puzzle in Puzzleland” by Sam Loyd , scanned by Ed Pegg Jr, 2005 · Public domain · via Wikimedia Commons

Short answer

Solve a sliding puzzle one row and one column at a time: finish the top row, then the left column, and repeat on the smaller puzzle that is left until only a 2 × 2 corner remains. The only tricky part is the last two tiles of each row or column, which you place together with a short "park and turn" move. Practise on our free Sliding Puzzle in 3 × 3, 4 × 4 or 5 × 5.

The 15 puzzle, a tray of fifteen numbered tiles and one empty space, has been a favourite since the 1870s. It looks like it needs luck or genius, but a simple layer-by-layer method solves it every time. This guide uses the 4 × 4 puzzle as the example; the same steps work on 3 × 3 and 5 × 5.

The goal and the rules

Is every sliding puzzle solvable?

No. If you take the tiles out and put them back at random, exactly half of all arrangements cannot be solved; the classic unsolvable example swaps just the 14 and 15. This is a mathematical property called parity. Puzzles that are shuffled by real slides, as ours are, can always be solved, because you can always undo the slides that mixed them.

The method: rows and columns, from the outside in

  1. Solve the top row (1, 2, 3, 4).
  2. Solve the left column (5, 9, 13). The 1 is already done.
  3. You now have a 3 × 3 puzzle in the bottom-right. Solve its top row (6, 7, 8), then its left column (10, 14).
  4. Only a 2 × 2 corner is left (11, 12, 15 and the space). Rotate those three tiles around the space until they are in order.

Once a row or column is finished, never move those tiles again. Every later move happens in the smaller area that remains.

Step 1 in detail: the first tiles of a row

Placing 1 and 2 is easy. Move the empty space next to the tile you want, then slide the tile one square at a time toward its home. To move a tile in a direction, bring the space to the square in front of it (going around the tile, not through finished tiles), then slide the tile into the space. Repeat until it arrives.

The trick for the last two tiles of a row

The 3 and 4 cannot simply be placed one after the other: putting 4 in the corner usually knocks 3 out of place. Use this "park and turn" move instead:

  1. Move tile 3 into the top-right corner, where 4 belongs.
  2. Move tile 4 directly below it, in the second row of the last column.
  3. Bring the empty space to the square where 3 belongs (top row, third column), without disturbing tiles 1, 2, 3 or 4.
  4. Slide 3 left into the space, then slide 4 up into the corner. The top row is done.

If 4 ends up in the corner while you are setting up, move it out of the way first, a couple of rows down, then try again. This happens to everyone.

The same trick for the left column

For the left column, the last two tiles are 9 and 13. Mirror the move:

  1. Move tile 13 into the place where 9 belongs (third row, first column).
  2. Move tile 9 directly to its right (third row, second column).
  3. Bring the space to the bottom-left corner.
  4. Slide 13 down into the corner, then slide 9 left. The column is done.

Finishing the last 2 × 2 corner

With only three tiles and a space left, the tiles can only rotate around the square. Keep moving them around in one direction until 11 and 12 sit in the row above and 15 sits to the left of the space. Because our puzzles are shuffled with real moves, this always works.

Tips to solve it faster

Why it is a good brain puzzle

Sliding puzzles train planning: to place one tile, you must think several moves ahead without breaking what you already built. If you like this kind of thinking, read our guides to solving Sudoku and winning at 2048, then play the 2048 game free.

Frequently asked questions

What is the 15 puzzle?

A 4 × 4 sliding puzzle with fifteen numbered tiles and one empty space. You slide tiles to put them in order.

Is every 15 puzzle solvable?

No. Half of all random arrangements are unsolvable, but puzzles shuffled by real slides can always be solved.

What is the easiest way to solve a sliding puzzle?

Solve the top row, then the left column, and repeat on the smaller puzzle until a 2 × 2 corner remains.

How do I place the last two tiles of a row?

Put the last tile where the second-to-last belongs, the second-to-last below it, then slide them both into place.

Does the method work for 3 × 3 and 5 × 5?

Yes. The same row-then-column method works for any size.

Sources and further reading

💙 If VSH helps you, please share it and help us improve.