THE CLASSIC 3×3 TILE PUZZLE

8 Puzzle Solver

Eight tiles and one gap. Enter your layout and get an optimal solution, one move at a time.

8-Puzzle Board

3 × 3 · CLASSIC
Ready

or use arrow keys ↑↓←→ to slide

Sliding Puzzle Board Screenshot Preview
Moves made: 0

Solver Controls

Browser-Powered

Ready to solve. Choose your layout or click Solve.

Board size

Both fast and shortest modes find optimal moves on 3×3.

Enter custom numbers
Photo puzzle optional
THE EIGHT PUZZLE

Solve any 3×3 sliding puzzle

The 8 puzzle looks simple: arrange the numbered tiles in order and leave the empty square at the end. The challenge is that only a tile beside the gap can slide. A useful move makes space for the tile you want next, even when that means sending the gap around the other side of the board.

Enter a position you copied from a game, a book or a physical puzzle. The board accepts every arrangement of the numbers 1 through 8 plus 0 for the blank. You can also shuffle a fresh, solvable position or choose a photo to make a picture puzzle.

Click Solve my puzzle to see a shortest route. Use the step controls to follow each tile move, or press Play to watch the whole sequence. The listed numbers identify which tile slides into the empty square.

A SOLUTION YOU CAN TRUST

Why every solvable board gets an answer

A 3×3 puzzle has 362,880 possible tile arrangements, but legal slides divide them into two groups. Exactly 181,440 are reachable from the standard goal. We check parity first, so an impossible layout is identified before the search begins.

In Fast and Shortest modes, the solver searches outward from your layout and from the goal at the same time. The two searches meet in the middle. Breadth-first search checks the shallowest routes first, which means the first complete route is guaranteed to use the fewest moves.

Every solvable 8 puzzle is within 31 moves of the goal. If a familiar hand-solving trick feels stuck, the answer is still reachable—try the move list and look for the pattern.

Enter and solve an 8 puzzle

  1. Choose 3 × 3 and enter all eight tiles and the blank.
  2. Let the parity check confirm the layout is reachable.
  3. Review the optimal tile sequence or play it step by step.

Practice with a strategy guide

Prefer solving with your own hands? Learn how to place the early tiles, finish a row’s final pair together and recognize an impossible swap in our How to Solve a Sliding Puzzle guide.

Once the 3×3 feels familiar, try the larger 15 Puzzle Solver .

GOOD QUESTIONS

Frequently asked questions

What is the 8 puzzle?

The 8 puzzle is a 3×3 sliding tile puzzle with eight numbered tiles and one empty square. Slide a tile next to the gap until the numbers are in order and the gap is in the bottom-right corner.

Does this 8 puzzle solver find the shortest solution?

Yes. A bidirectional breadth-first search finds an optimal path for every solvable 3×3 layout. When it finishes, no sequence with fewer tile moves can solve that board.

Why can an 8 puzzle be impossible to solve?

For the standard goal, a 3×3 layout is solvable only when its inversion count is even. Count pairs of numbered tiles that appear in the wrong relative order while reading across each row, ignoring the gap. A single swap changes the parity and makes that layout unreachable.

Can I enter a layout from a physical puzzle?

Yes. Open Enter your own board and type the nine tiles in reading order, using 0 for the gap. Separate values with spaces, commas or newlines. The solver checks that every value from 0 through 8 appears once.

Does it support photo puzzles?

Yes. Select a square or rectangular image to crop it into a 3×3 picture puzzle. The numbers remain over the tiles as a guide, and your photo is processed locally in your browser.