Slide the numbered tiles into order. Click a tile adjacent to the empty space to move it — or use the arrow keys.
Arrow keys also work — they move the empty space in that direction.
The 15 puzzle is one of the oldest and most beloved mechanical puzzles in history. The object is deceptively simple: a 4x4 grid holds fifteen numbered tiles and one empty space. By sliding tiles into the blank, you must rearrange them from a scrambled state into numerical order, with the empty space in the bottom-right corner. Despite this simplicity, the puzzle can require well over a hundred moves to solve and has captivated mathematicians and casual players alike for well over a century.
The puzzle was invented around 1874 by Noyes Palmer Chapman, a postmaster from Canastota, New York. Chapman presented it to members of the American Novelties Company, and commercial versions began appearing in the late 1870s. By 1880 the craze had swept through the United States, Canada, and Europe, with newspapers reporting workers distracted at their desks and commuters sliding tiles on trains.
The legendary puzzle designer Sam Loyd later claimed to have invented the puzzle himself, a claim historians have thoroughly debunked. Loyd did, however, offer a tantalizing $1,000 prize for solving a specific configuration — tiles 14 and 15 swapped from the goal position. Unknown to most contestants at the time, that particular arrangement is mathematically impossible to solve. No prize was ever awarded, and the problem drove the puzzle's popularity even higher as frustrated solvers refused to believe it couldn't be done.
Not every scrambled arrangement of the 15 puzzle can be solved. Exactly half of all possible permutations are solvable, and half are not — and there is no sequence of legal moves that can bridge the two groups. A position is solvable if and only if the following condition holds: count the number of inversions (pairs of tiles where a higher-numbered tile appears before a lower-numbered tile in the flattened grid), then add the row number of the blank tile counting from the bottom. If that sum is even, the puzzle is solvable.
This game always generates solvable scrambles by checking this condition before presenting each new puzzle. If a randomly generated shuffle turns out unsolvable, the game simply swaps two adjacent non-blank tiles to flip the parity — a trick that mathematicians proved valid in the 1870s.
There is no single move that "solves" the 15 puzzle — it requires a sequence of coordinated steps. Here are the main approaches:
The 8-puzzle (3x3 grid) is a popular variant used extensively in computer science courses to teach search algorithms. It is simpler than the 15-puzzle but still requires careful planning. The 24-puzzle (5x5 grid) is significantly harder — optimal solutions can require over 100 moves, and even fast computers take considerable time to find the absolute shortest solution.
Beyond numbers, sliding puzzles have been created with images, letters, colors, and shapes. Some versions use a 4x4 grid with a picture divided into 15 pieces, requiring the solver to reconstruct the image. These "picture puzzles" were especially popular in the late 19th and early 20th centuries as novelty promotional items.
The puzzle has influenced mathematics, computer science, and popular culture. It directly inspired work on permutation groups, parity arguments, and graph theory. In AI and computer science, the 8-puzzle is a classic benchmark problem for testing search algorithms like breadth-first search, iterative deepening, and A*. Modern speedcubers and puzzle enthusiasts still compete to solve the 15 puzzle in the fewest possible moves, with world-record solvers achieving solutions close to the theoretical optimum.