GUIDE & REFERENCE

What is the hardest 3×3 slide puzzle, and how long does it take?

Find the hardest 3×3 slide-puzzle boards, how many moves they take, and how a typical shortest solution compares. Then enter a board in the solver.

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.

QUICK ANSWERS

Frequently Asked Questions

What is the hardest 8-puzzle, and how many moves does it take?

For the usual goal of 1 through 8 with the blank in the bottom-right corner, the hardest 8-puzzle takes 31 moves. "Hardest" means the longest shortest path, not the messiest-looking board.

How many boards take that many moves?

Exactly two solvable starting positions require 31 moves. Every other solvable board can be finished in 30 moves or fewer. That count is recorded in OEIS A089473 and in Wolfe's 2009 note.

What do those two boards look like?

One is 8 6 7 / 2 5 4 / 3 0 1. The other is 6 4 7 / 8 5 0 / 3 2 1. If a list you are reading uses a different goal position for the blank, the "hardest" starts will look different.

What is a typical number of moves for a 3×3?

Reinefeld's 1993 enumeration of every solvable 8-puzzle gives 21.97 as the average length of all optimal solution paths — about 22 moves on a shortest path.

How can I check one of these boards myself?

Enter it in the 3×3 solver, with 0 for the blank. On 3×3 the solver returns a shortest path, so the number of steps it shows for either board should be 31.

If I solved a board in more than 31 moves, did I find a harder puzzle?

No. The 31-move figure is a shortest-path length. A longer play-through means the path had detours, or the start was not one of the two maximum boards, or both.

Is this the same idea as God's number for the 15 puzzle?

Yes, in the sense that both ask for the longest shortest path. The 15-puzzle number is larger.

Can an unsolvable board be harder than these two?

An unsolvable board has no solution length at all. The two 31-move positions are the extreme among boards that can be finished by sliding.

CONTINUE EXPLORING

Keep Going

PUT IT INTO PRACTICE

Ready to Slide or Solve?

Practice on a fresh 3×3 board in your browser, or enter a scrambled puzzle into the solver to inspect every move.