Home / Brain Teasers / Sliding Puzzle

Sliding Puzzle

The sliding puzzle, popularized as the 15-puzzle in the 1870s, has fifteen numbered tiles and one empty space on a square frame. You win by sliding tiles into the gap until the numbers run in order. Sam Loyd's prize version set off a worldwide craze in 1880, though it was impossible to solve.

Brain Teasers Medium 1 Player

Sliding Puzzle rules

The board is a 4×4 grid with tiles numbered 1 to 15 plus one empty square. The tiles start scrambled, and you can only move a tile that sits directly next to the empty space.

Each move slides an adjacent tile into the gap, which moves the empty square to where that tile was. There's no lifting or jumping. Every change is one slide at a time.

You win when the tiles read 1 through 15 left to right, top to bottom, with the empty square in the bottom-right corner. Only half of all random scrambles are solvable, a fact tied to the parity of the arrangement.

Sliding Puzzle strategy and tips

Solve top-down, left-to-right

Lock in the top row first (1, 2, 3, 4), then the second row, before you touch the bottom half. Once a tile is in the right place, try not to disturb it.

Use the corner trick for row ends

When placing the last two tiles of a row, set the rightmost tile above its target and the next tile below it, then rotate them in together. Placing them one at a time tends to deadlock.

Finish the last two rows as columns

Once the top two rows are done, solve the bottom 4×2 region column by column. Pair the two tiles in each column and rotate them into place.

Think in cycles, not single slides

Moving one tile to its target usually means circling the empty square around a group of tiles. Plan the loop before you start sliding so you don't undo your progress.

Frequently asked questions

Are all 15-puzzle scrambles solvable?

No. Exactly half of all arrangements can be solved, which is 16!/2 of them. Solvability depends on the parity of tile inversions combined with the row of the blank square.

What is the maximum number of moves to solve the 15-puzzle?

The hardest solvable positions need 80 single-tile moves to reach the goal. That result was proven by computer search.

Why was Sam Loyd's puzzle impossible?

Loyd offered a prize for swapping only the 14 and 15 tiles on a solved board. That one swap flips the parity, so the position is mathematically unsolvable.

How do I solve a sliding puzzle without getting stuck?

Work in order. Finish the top rows first, then solve the bottom two rows by columns. Place the last two tiles of any row or column with a rotation instead of forcing them in one at a time.