15 Puzzle

Play the classic 15 puzzle in your browser: slide the numbered tiles into the empty space until they are in order from 1 to 15. Also in 3×3 (8 puzzle) and 5×5 (24 puzzle). Every shuffle is guaranteed to be solvable. Click a tile (a whole row or column slides at once) or use the arrow keys, and beat your best time and move count.

About this tool

What is the 15 puzzle?

The 15 puzzle is a sliding puzzle with 15 numbered tiles and one empty space in a 4×4 frame. A tile next to the empty space can slide into it. Starting from a shuffled position, put the tiles back in order: 1 to 4 in the top row, 5 to 8 in the second, and so on, with the empty space in the bottom-right corner.

How to play

  1. Choose a size: 3×3 (8 puzzle), 4×4 (15 puzzle) or 5×5 (24 puzzle), and press New game.
  2. Click or tap a tile in the same row or column as the empty space. It slides toward the space, together with any tiles between them.
  3. Or click the board and use the arrow keys (or W A S D): the tile next to the space moves in that direction.
  4. The timer starts with your first move. Each tile that moves counts as one move.
  5. Tiles already in their final position are tinted green.

Strategy

The standard method solves the puzzle one row and one column at a time, shrinking it until only a 2×2 block remains. Once a row or column is finished, never touch it again.

1. Solve the top row

  • Bring 1 to the top-left corner, then 2 next to it, then 3. Move the empty space around a tile to push it: to move a tile one step, put the space where you want the tile to go and slide the tile in.
  • The last two tiles of a row (3 and 4 on a 4×4) cannot be placed one by one: pushing 4 into the corner would knock 3 out again. Place them as a pair instead:
    1. Put 3 in the top-right corner (the target of 4) and 4 directly below it.
    2. Bring the empty space to the target of 3 (left of the corner) without disturbing 1, 2, 3 or 4.
    3. Slide 3 left, then slide 4 up. The row is complete.
  • If 4 gets stuck in the corner before 3 is ready, move 4 down and out of the way first, then set up the pair again.

2. Solve the left column

Do the same for the left column: 5, then 9 and 13 on a 4×4. The last two tiles go in as a pair, turned the other way: put 9 in the bottom-left corner (the target of 13) and 13 to its right, bring the space above 9, then slide 9 up and 13 left.

3. Repeat on the smaller puzzle

Now the remaining tiles form a smaller puzzle: 3×3 on a 4×4, or 4×4 on a 5×5. Solve its top row and left column with the same steps (6, 7, 8 and then 10, 14 on a 4×4). On a 5×5, repeat once more.

4. Finish the last 2×2 block

The last three tiles (11, 12 and 15 on a 4×4, or 5, 6 and 8 on a 3×3) share a 2×2 block with the empty space. Rotate the space around the block in one direction until all three fall into place. Because every puzzle here is solvable, the three tiles are always in an order that rotating can fix.

Faster solving

  • Plan the path of the empty space before you move. Fewer moves also means a faster time.
  • Move whole rows or columns with one click instead of one tile at a time.
  • While you set up one tile, try to move the next tile closer, too.

FAQ

Is every puzzle solvable?

Yes. Only half of all arrangements of the tiles can be solved (for example, swapping just 14 and 15 cannot be fixed, as in Sam Loyd's famous "14-15 puzzle"). The shuffle checks this and only gives you solvable puzzles.

What is the fewest number of moves?

Any 4×4 position can be solved in at most 80 single-tile moves, but finding the shortest solution is hard even for a computer. The method above usually takes 100 to 200 moves.

What does the Hint button do?

It solves the puzzle from the current position and shows the next tile to move. On 3×3 it finds the shortest possible solution; on 4×4 and 5×5 it finds a short solution quickly (weighted A* search). If you follow the hints, they stay on the same solution; if you make other moves, the next hint is worked out again from the new position.

A puzzle solved with hints is not counted for your best results.

Is my game saved?

Yes. The board, the move count, the timer and your best results are saved in this browser.

Where can I see my past games?

Open Records & history below the game. It shows your best result for each size and your last 10 games with the date and time and the number of hints used. They are saved in this browser only.