The hardest 8-puzzle, with the usual goal of tiles 1 through 8 and the blank in the bottom-right corner, takes 31 moves. Only two starting positions need that many; every other solvable board can be finished in 30 moves or fewer.
That figure is a shortest-path length, not a casual play-through. If you finish one of those boards in more than 31 slides, the extra moves are detours, not evidence of a harder puzzle. The two start boards are written out below, and you can enter either board in the 3×3 solver to follow a shortest path.
How many moves the hardest 8-puzzle takes
"Hardest" here means the maximum, over all solvable start boards, of the length of a shortest solution. It is not the board that looks the most shuffled, and it is not a board that cannot be finished at all.
For the standard 8-puzzle goal — 1 2 3 / 4 5 6 / 7 8 0 — that maximum is 31. Jason Wolfe's 2009 note, based on a breadth-first search from the goal, gives the two start positions and states that both require at least 31 moves, and that all other instances can be solved in 30 moves or less. The On-Line Encyclopedia of Integer Sequences entry A089473 counts how many 8-puzzle configurations require each depth when the blank's goal is in a corner; the count at depth 31 is 2, which matches those two boards.
A useful contrast: the 14-15 starting position, which cannot be solved, is not a harder 8-puzzle. It belongs to the other half of all arrangements, the ones that legal slides never reach.
The two 31-move boards
Write 0 or a gap for the blank, left to right, top to bottom:
8 6 7 6 4 7
2 5 4 8 5 0
3 0 1 3 2 1
The first board has the blank in the middle of the bottom row; the second has it in the middle of the right column. They are the only two starts at this depth for the goal above. Other write-ups sometimes list different "hard" boards because they use a different goal, such as the blank in the center or in the top-left corner.
What a typical 3×3 solution length looks like
Most solvable 8-puzzles are not 31-move problems. Alexander Reinefeld's 1993 IJCAI paper, which enumerated every solvable position, reports that the average length of all optimal solution paths is 21.97 — almost 22 moves for a random solvable configuration. That average is taken over shortest solutions, so a casual play that wanders will usually take more.
The same distribution that gives two boards at 31 moves also shows how quickly the counts fall after the peak. A finished game in the mid-20s, measured along a shortest path, is ordinary. A 31-move shortest path is the extreme.
This is the comparison you want if you have been watching a move counter and wondering whether a result is any good. The counter on a casual game records the path you played, which may be longer than the shortest path for the same start.
Using the move counter on a game
You can open a 3×3 game with a move counter on the homepage and finish a shuffled board, then compare the counter with the 22-move average and the 31-move maximum. The homepage shuffles by legal slides, so the board you get is always solvable. The counter will not tell you whether your path was shortest; it only tells you how many slides you used.
How to check a 31-move board yourself
To see a shortest path for either board, set the solver to 3×3 and type the tiles in reading order, using 0 for the blank. The solver first checks that the position can be reached from the goal; both of these boards can. It then returns a shortest path: on 3×3, no other sequence of moves finishes in fewer steps.
Type carefully. A single swapped pair of digits changes the position completely, and may even make it unsolvable. The first board is 8 6 7 2 5 4 3 0 1. The second is 6 4 7 8 5 0 3 2 1.
If you are writing a solver rather than typing a board, how A* finds a shortest 8-puzzle path walks through Manhattan distance and a short Python example that you can run on the same two starts.
A longer version of the same question
The same "longest shortest path" question on the 4×4 board is the most moves a 15 puzzle can require. The number is larger, and the count of boards that sit at that length is larger too.
One difference matters if you want to inspect a 15-puzzle path on this site. The 3×3 solver used above returns a shortest path, which is why it can show the 31-move length. The 4×4 mode returns a working path and does not claim that the path is shortest, so it is not a way to confirm the 15-puzzle figure.
Why the 3×3 solver can show this length
The 3×3 reachable space has 181,440 boards, and a shortest-path search on that space is the method behind the 31-move result. That is also why a 3×3 entry in the solver can be compared with the length on this page.