Sliding puzzle (15-puzzle)

The classic sliding-tile puzzle in 3x3, 4x4 and 5x5, always solvable, with move counter, best records, hints and tile sliding by tap or arrow keys.

🔒 Your data stays in your browser: nothing you type or upload is sent to a server.

How it works

Slide the numbered tiles into order, with the gap at the bottom right. Sizes are 3x3 (8 tiles), 4x4 (15) and 5x5 (24). Half of all arrangements of the tiles cannot be solved, so the shuffle checks the parity of the inversions and the blank row and always produces a reachable position. Tap a tile to slide it, or a tile in line with the gap to slide the whole row. The hint plays a step-by-step method, row by row, so it always finishes but is not the shortest route. The best move count and time per size are kept in this browser.

Common questions

Why can some 15-puzzles not be solved?

Each slide is an exchange of the gap with a neighbour, which preserves a parity invariant (inversions of the tile order plus the row of the gap on even-width boards). Swapping just two tiles flips that parity and makes the position unreachable. This game only shuffles within the reachable half.

How are moves counted?

Each tile that moves counts as one move. Sliding a row of three tiles with one tap counts three, the same as moving them one by one.

Related tools