How to Solve the 15-Puzzle — Layer-by-Layer Technique

How to Solve the 15-Puzzle — Layer-by-Layer Technique

The 15-Puzzle (or sliding puzzle) was invented in the 1870s by Noyes Chapman. It went viral in 1880; New York’s Saturday Evening Post described it as ‘the modern sphinx.’ Sam Loyd offered $1,000 (about $32,000 today) for a solution to a specifically-impossible variant. Nobody won. Here’s how to solve the real (solvable) version.

The setup

4×4 grid with 15 numbered tiles and 1 empty space. Tiles can only slide into the empty space. Goal: arrange tiles 1-15 in order, with the empty space in the bottom-right.

Random shuffles produce solvable positions about half the time. Modern apps (including ours) guarantee solvable starting positions.

The minimum-move count

Optimal solutions for the 15-puzzle require an average of 53 moves. The maximum is 80 moves (for the worst-case starting position). Most casual players take 100-200 moves to solve.

Technique 1: Solve top row first

Start with tile 1. Move it to the top-left corner. Tiles 2, 3, 4 to their positions. Be careful — you can’t just place them; tile 4 needs to be inserted in a specific way.

Standard trick for placing tile 4 in the corner: first move tile 4 to position (1, 4) and tile 3 to position (2, 4). Then ‘rotate’ them into place by moving tile 4 up and tile 3 left.

Technique 2: Then second row

Tile 5, 6, 7, 8. Use the same insertion trick for tile 8 (the right-edge tile of the second row).

After two rows are solved, you have a 2×4 region containing tiles 9, 10, 11, 12, 13, 14, 15 plus the empty space.

Technique 3: Bottom two rows together

DO NOT solve the third row independently — you can’t fit tile 13 (bottom-left of solved area) without disturbing the third row.

Instead: solve the left column of the bottom two rows together. Place tile 9 and tile 13 simultaneously using a specific rotation pattern. Then 10/14, 11/15.

Technique 4: The 3-cycle

By the time you have one row left, you have 3 tiles plus the empty space. There are 6 arrangements. Half are solvable; half aren’t.

Solvable: use the 3-cycle technique — rotate 3 tiles clockwise or counterclockwise using the empty space.

Unsolvable: the random shuffle gave you a starting position that’s parity-flipped. There’s no fix — you have to restart. Our build avoids this.

Speed-solving

World-record solving times for the 15-puzzle: ~3 seconds via algorithmic execution. Human speed-solvers (no computer) can solve in 10-15 seconds with practice.

Key to speed: don’t think during execution. Memorize the techniques and execute the moves as a motor pattern, not as conscious decisions.

Practice

Play our 15 Puzzle. Start at 3×3 (Easy) to learn the techniques. Move to 4×4 (the classic 15-puzzle). Then 5×5 and 6×6 if you want a real challenge.

Related reading

Related guides