Sliding Puzzle Solver
Stuck on a sliding puzzle? Enter your board (or tap Scramble for a demo), then tap Solve — this free solver finds the shortest solution and plays it out tile by tile on the grid. It handles the 3×3 (8 puzzle) and 4×4 (15 puzzle), and tells you if a board is impossible. No download, no sign-up.
Play the sliding puzzle free →
How to use the sliding puzzle solver
- Pick the size — 3×3 or 4×4 — to match your puzzle.
- Type the current arrangement into the grid: each number once, with 0 or a blank cell for the empty square.
- Or tap Scramble to drop in a random solvable board to try.
- Tap Solve — the shortest solution plays out on the grid, and the move count is shown.
- Tap Reset to return the grid to the solved order.
How the solver works
The solver searches for the fewest possible moves using IDA* with a Manhattan-distance and linear-conflict heuristic — the standard optimal method for sliding puzzles — so the solution it plays is the shortest one. It first checks the board is even solvable: by a parity rule, exactly half of all tile arrangements can never be finished, and the solver detects those instead of searching forever.
The animation then slides the tiles one at a time to the solved order, so you can follow (or copy) the exact sequence.
When to use a sliding puzzle solver
- You are stuck. Watch the optimal way out of a 15 puzzle that has beaten you.
- Check if a board is even possible. Physical puzzles and shuffled apps can be in the unsolvable half — the solver tells you.
- Learn the technique. Watch how the optimal solution sequences its moves and pick up the patterns.
About the 15 puzzle
The 15 puzzle (a 4×4 board of tiles 1–15 with one gap) and its smaller cousin the 8 puzzle (3×3) are the classic sliding puzzles, invented in the 1870s. Any solvable board can be finished in at most 80 moves on a 4×4, and this solver finds the shortest path for the board you enter. Want to play rather than solve? Try the sliding puzzle itself, with 3×3, 4×4 and 5×5 boards.
Sliding puzzle solver: FAQ
How do I use the sliding puzzle solver?
Choose 3×3 or 4×4, then type your board into the grid — each number once, with 0 or a blank cell for the empty square — or tap Scramble for a random board. Tap Solve and the shortest solution plays out tile by tile, with the move count shown.
Does it find the shortest solution?
Yes. It uses IDA* with a Manhattan-distance and linear-conflict heuristic, which is guaranteed to find an optimal (fewest-move) solution for the board you enter. Extremely scrambled 4×4 boards are capped for speed and reported if they exceed the budget.
Why does it say my puzzle is unsolvable?
About half of all sliding-puzzle arrangements can never be solved — a property called parity. If two tiles are swapped relative to a solvable board, no sequence of legal slides can fix it. The solver checks parity and tells you instead of searching forever.
Is it free?
Yes — the solver runs free in your browser on phone, tablet and desktop, with no download and no sign-up. The solving happens on your own device.