Sliding Puzzle

15 Puzzle

Fifteen numbered tiles, one empty square and a new random shuffle every game. Every board here can be solved.

What is the 15 puzzle?

The 15 puzzle is the classic sliding puzzle: fifteen square tiles numbered 1 to 15 in a 4x4 frame, with one space left empty. A tile next to the space can slide into it, and the goal is to put the tiles back in order, 1 to 15 from the top left, with the empty space in the bottom-right corner.

The board above is shuffled at random, like a puzzle tipped out of its box, but only into positions that can be solved. Press New game for a fresh shuffle. Your moves and time are counted, and you can undo a move or restart the board at any point.

Other names: Gem Puzzle, Boss Puzzle, Game of Fifteen

The same puzzle goes by many names. In English it is also called the Gem Puzzle, the Boss Puzzle, the Game of Fifteen and the Mystic Square, and in French the jeu de taquin. The patent application of 1880, told below, called it the Block Solitaire Puzzle.

Smaller and larger boards follow exactly the same rules. The 3x3 board is known as the 8 puzzle, and the 5x5 board as the 24 puzzle.

A short history of the 15 puzzle

The puzzle is usually credited to Noyes Palmer Chapman, a postmaster in Canastota, New York, who applied for a patent on his “Block Solitaire Puzzle” on 21 February 1880. The patent was refused, but the puzzle itself became a craze that year: in the United States early in 1880, in Canada by March and across Europe by April. By the summer, the fad had mostly passed.

For many years, the puzzle writer Sam Loyd was named as its inventor. He claimed it from 1891 until his death in 1911, and told of a $1,000 prize he had offered for solving the board with 14 and 15 swapped. Research by Jerry Slocum and Dic Sonneveld, published in their 2006 book The 15 Puzzle, showed that Loyd had no part in its invention or its early popularity.

Why the 14–15 puzzle can't be solved

Take a solved board, swap only the 14 and the 15, and no amount of sliding will ever put them back. In 1879, as the puzzle began to spread, William Woolsey Johnson and William Edward Story proved in the American Journal of Mathematics that exactly half of all the ways to put the tiles in the frame can never be solved, and that all the rest can.

You can check any 4x4 board yourself:

  • Read the tiles row by row, ignoring the empty space, and count the pairs that are in the wrong order: a bigger number before a smaller one.
  • Add the number of the row the empty space is in, counting 1 to 4 from the bottom.
  • If the total is odd, the board can be solved. If it is even, it can't.

The swapped 14–15 board has one pair in the wrong order and the empty space on row 1, a total of 2, so it can't be solved. Every board this page deals can be solved.

The 15 puzzle in numbers

  • 20,922,789,888,000 ways to put the fifteen tiles and the space in the frame. Exactly half of them, 10,461,394,944,000, can be solved.
  • 80 moves: the most any solvable board needs, counting each tile that slides as one move. A computer search published in 1999 found only 17 positions that need all 80.
  • 43 moves: the most any solvable board needs if sliding a whole row or column of tiles at once counts as a single move.

Learn to solve it

Solving the 15 puzzle by trial and error is hard, but a simple method works on every board. How to Solve a Sliding Puzzle, Step by Step explains it with boards to practise on, and How to Solve the Last Two Rows covers the part where most players get stuck.

Play it level by level

Prefer fixed levels, with stars, leaderboards and solving tips for each board size? The 4x4 page has the 15 puzzle as a series of levels that get harder as you go.

Back to the puzzle