How to play
The tiles are numbered, and one square is empty. Slide a tile into the gap to move it, and keep going until the numbers run in order from the top-left, row by row, with the gap in the bottom-right corner.
- Click or tap a tile next to the gap to slide it in. Click a tile further along the same row or column and the whole line slides along at once.
- Swipe on the board to move the tile next to the gap in that direction, or click the board and use the arrow keys.
- Moves counts every tile that slides, so sliding a line of three counts as three. That is the usual way to count, and how the shortest solutions below are measured.
Sizes
- 3×3, the 8 puzzle, takes a minute or two. It has 181,440 possible positions, and the full search behind this page shows that every one can be solved in 31 moves or fewer; only two positions need all 31. A random shuffle needs 22 moves on average. When you finish a 3×3, the result tells you the shortest solution for your shuffle.
- 4×4 is the classic 15 puzzle, with about 10.5 trillion possible positions. The hardest of them need 80 moves.
- 5×5, the 24 puzzle, is a long solve; the method is the same, there is just more of it.
Colours gives each tile the colour of its home square, so the finished board is a smooth gradient. It is a good way to see which area of the board is still out of place.
Hints
Hint outlines the next tile to move. On 3×3 it follows a shortest solution and tells you how many moves are left. On 4×4 it follows a quick solution found by search, and on 5×5 it follows the row-by-row method from how to solve a sliding puzzle, which works on any size.
Why every shuffle here can be solved
Only half of all arrangements of the tiles can be solved. In 1879 W. W. Johnson and W. E. Story proved that no sequence of moves can turn the other half into the finished puzzle. The shuffles on this page always come from the solvable half, so you never get a puzzle with no way out.
Where the 15 puzzle comes from
The 15 puzzle was made in the 1870s by Noyes Palmer Chapman, a postmaster in Canastota, New York, and became a craze in the United States in 1880. Chapman applied for a patent for his "Block Solitaire Puzzle" in February 1880. The puzzle writer Sam Loyd later claimed, from 1891 until his death, to have invented it, but he had nothing to do with it; he did make the 14–15 version above famous, by offering $1,000 to anyone who could solve it.
More puzzles: nonograms, Sudoku and the memory game.
Frequently asked questions
How do you play the sliding puzzle?
Slide tiles into the empty square, one at a time, until the numbers are in order from the top-left with the gap in the bottom-right corner. Click a tile next to the gap, swipe, or use the arrow keys.
Is every sliding puzzle solvable?
No. Exactly half of all arrangements of the tiles cannot be solved, as W. W. Johnson and W. E. Story proved in 1879. Every shuffle on this page comes from the solvable half.
What is the 15 puzzle?
The classic 4×4 sliding puzzle: fifteen numbered tiles and one gap in a square frame. It became a craze in the United States in 1880.
What is the fewest moves to solve a 3×3 sliding puzzle?
It depends on the shuffle, but every 3×3 position can be solved in 31 moves or fewer, and a random one needs 22 on average. After you solve a 3×3 here, the result shows the shortest solution for your shuffle.
What is the hardest 15 puzzle?
The hardest positions of the 4×4 puzzle need 80 moves to solve, counting each tile moved as one move.
How do you solve a sliding puzzle?
Solve the top rows one at a time, then the last two rows one column at a time. The step that catches people out is the last two tiles of a row, which have to go in together; how to solve a sliding puzzle shows the trick.