Here’s how to solve a sliding puzzle: work in layers. Finish the top row, then the left column, and repeat on the smaller board until only a 2×2 corner is left, which you rotate into place. Place the last two tiles of each row together, not one by one.
That one method works on a 3x3, a 4x4 and bigger boards. Below you’ll find how to check that your board can be solved at all, then the full method with a diagram for every key step.
First, check that your puzzle can be solved
Exactly half of all possible arrangements can never be finished, however cleverly you slide the tiles. It takes less than a minute to find out which half your board is in, so do this before anything else.
Count the inversions. Read the tiles in order, left to right and top to bottom, skipping the blank. An inversion is any pair where a larger number comes before a smaller one.
On a board with an odd width (3x3 or 5x5), an even number of inversions means the puzzle can be solved. The board above has 4, so it’s fine. Where the blank sits doesn’t matter.
On a 4x4, the blank’s row matters too. Count the blank’s row from the bottom (the bottom row is 1, the top row is 4) and add it to the inversion count. The board can be solved only if the total is odd.
Every legal slide keeps this parity the same, so an impossible board stays impossible no matter what you do. Puzzles usually end up that way when two tiles have been taken out and put back in the wrong places, or when a board was copied down with a mistake. The fix is to swap two tiles (not the blank). There is a full explanation, with more examples, on the unsolvable sliding puzzle page.
How to solve a sliding puzzle: the layer method in one picture
The method shrinks the puzzle one layer at a time:
- Finish the top row.
- Finish the left column.
- What’s left is the same puzzle, one size smaller. Repeat steps 1 and 2 on it.
- When only a 2x2 block is left, rotate its three tiles around until they line up.
The rule that makes this work: once a row or column is finished, leave it alone. Move the blank around finished tiles, never through them. Breaking a finished row to save a move almost always costs more moves later, because you have to build the row again.
Moving one tile where you want it
Every step of the method comes down to moving one chosen tile to one chosen square. Tiles only move into the blank, so you steer a tile by steering the blank: bring the blank round to the side of the tile you want it to travel toward, then slide the tile into it. To keep going in the same direction, walk the blank around the tile (four moves) to its far side again, and slide once more. It feels slow at first, but it is completely reliable, and it never disturbs tiles you’ve already placed as long as you route the blank around them.
How to solve a 3x3 sliding puzzle
On a 3x3 (the 8-puzzle), the layers are short: one row of three, one column of two more, then a 2x2 finish.
Place tile 1
Bring tile 1 to the top-left corner. Walk the blank to the square next to tile 1 on the side you want it to move toward, then slide 1 one square at a time along the top row or down the left column. Don’t worry about the other tiles yet.
The last tile of a row: place 2 and 3 together
This is the step that trips most people up. If you put 2 in the top-middle first and then go looking for 3, you’ll find that 3 can only slide into the top-right corner by pushing 2 out of place again.
Instead, set 2 and 3 up as a pair: put 2 in the top-right corner and 3 directly below it, then bring the blank to the top-middle square.
Now two moves finish the row: slide 2 left, then slide 3 up.
Getting 2 and 3 into the setup position takes some shuffling, but it can always be done without touching tile 1. The same pair idea finishes the last two tiles of any row, on any size of board.
Finish the bottom 2×3 by rotating
With the top row done, the bottom two rows hold six squares. First the left column: tiles 4 and 7 go in as a vertical pair. Put 4 in the bottom-left corner (where 7 belongs) and 7 directly to its right, then move the blank to the middle-left square.
Then slide 4 up and 7 left. The left column now reads 1, 4, 7.
What’s left is a 2x2 block in the bottom-right holding three tiles (5, 6 and 8) and the blank. These tiles can only travel around the block in a circle, so keep turning them in one direction until they line up.
If the three tiles come round in the wrong order and won’t line up however long you turn them, the board was never solvable: go back to the inversion check. To see the shortest solution for your exact board instead, use the 3x3 sliding puzzle solver.
How to solve a 4x4 sliding puzzle
A 4x4 (the 15 puzzle) uses the same layers, with one extra step at the start.
Top row: 1, 2, then 3 and 4 as a pair. Place 1 and 2 in the first two squares of the top row. For the last two, use the pair trick: put 3 in the top-right corner, 4 directly below it, and bring the blank to the third square of the top row. Then slide 3 left and 4 up.
Left column: 5, then 9 and 13 as a pair. Put 5 under 1. Then set up a vertical pair: 9 in the bottom-left corner (where 13 belongs), 13 directly to its right, and the blank just above 9. Slide 9 up, then 13 left.
The rest is a 3x3. Tiles 6, 7, 8, 10, 11, 12, 14 and 15 now sit in a 3x3 area in the bottom-right. Solve it exactly like the 8-puzzle above: its top row (6, 7, 8) with the pair trick, its left column (10 and 14) as a vertical pair, then the 2x2 rotation with 11, 12 and 15. Never disturb the finished top row and left column.
Your hand solution will use more moves than necessary, which is normal. A 4x4 never needs more than 80 moves, and the 4x4 sliding puzzle solver finds the shortest solution if you want to compare.
Bigger boards (5x5 and up)
The method doesn’t change on bigger boards; there are just more layers. On a 5x5, finish the top row (placing 4 and 5 as a pair) and the left column (16 and 21 as a pair), and you’re left with a 4x4. Solve that as above, then the 3x3 inside it, then the final 2x2. Each finished row and column shrinks the puzzle by one. For long boards like this, the 5x5 sliding puzzle solver gives you a complete move list.
Common mistakes
Placing the last two tiles of a row one at a time. This is the big one. The row looks almost done, but the last tile can’t get in without moving a tile you already placed. Always set the last two tiles up as a pair and slide them in together.
Breaking a finished row and not putting it back. Sometimes you do need to move a finished tile out of the way for a moment. That’s fine, as long as you put it back straight away. The trouble starts when you leave it out and carry on, and the row quietly falls apart.
Not checking whether the puzzle can be solved. If two tiles have been swapped, you can get everything right except the very last pair and then go round in circles. A quick inversion count at the start saves that frustration.
Working on the wrong part of the board. It’s tempting to fix whatever tile looks easiest. Stick to the order: top row, left column, then the smaller puzzle. Tiles you place out of order will just get pushed around again.
Stuck? Let the solver do it
If you’d rather not work it out by hand, or you’ve been going in circles, enter your board in the sliding puzzle solver. It checks whether the board can be solved and lists every move from where you are to the finished puzzle. To follow along on a real puzzle, the sliding puzzle solver step by step shows a diagram for every single move.
For reference, a 3x3 never needs more than 31 moves. The layer method will usually take more than the shortest solution, so don’t worry if your count is higher than the solver’s.