lazycatthemes
Sliding Puzzle Solver

5x5 Sliding Puzzle Solver

Free 5x5 sliding puzzle solver. IDA* with the Manhattan-distance heuristic solves the 8-puzzle in a reasonable number of moves.

5x5 Sliding Puzzle Solver tool

Enter your 3x3 board. Use 0 for the empty tile. Goal is 1-8 in order with 0 in the bottom-right.

Solved in 2 moves.

Step 0 / 2

How the 5x5 Sliding Puzzle Solver works

The search is iterative deepening: it tries a limit of 10 moves, then 11, then 12, and so on. Each pass uses Manhattan distance as the heuristic, which never overestimates, so the first solution found at a given depth is an optimal one.

Manhattan distance is the right measure for the 8-puzzle because the blank moves for free. Summed over every tile, it is cheap to compute and tight enough to keep the node count manageable on the standard hardest board.

Move counts

The canonical hardest 8-puzzle takes 31 moves and this solves it without a precomputed table, which is the point of the heuristic. Longer scrambles stay tractable because the search prunes on distance rather than exploring blindly.

Frequently asked questions

Is the 5x5 Sliding Puzzle Solver free?

Yes. No signup, no paywall, nothing to install.

Where does the solving happen?

In your browser. The board state never leaves the page, and the search uses the same 359,039-word dictionary where words are involved.

What if it cannot find a solution?

It tells you. Exhausting the search space is a real answer, not a failure to be hidden.