3x3 Sliding Puzzle Solver
Enter your 3x3 puzzle and get the shortest possible solution in under a second.
How many moves does a 3x3 board need?
For the usual goal, the middle half of all 181,440 reachable boards needs 20–24 single-tile moves, with a median of 22. This is an exhaustive distance-table result, not a player survey or an estimate for a few scrambles. Boards close to the target can need 0, 1 or 2 moves. The proven worst case is 31, and the completed result gives the shortest count for your exact board.
Practical tips for this board
- Use the centre blank as working space instead of immediately pushing it into a corner.
- Read the two-move example below and follow tile directions; the blank travels the opposite way.
- For a one-move hint, reveal First slide before revealing the full route.
- If only tiles 7 and 8 are reversed, check parity rather than repeating loops around the bottom row.
Solve your 3x3 slide puzzle
This page is a 3x3 sliding puzzle solver. It opens on a 3x3 board, ready to go. Press Edit start, tap two tiles to swap them until the board matches yours, or type the numbers row by row (0 for the gap). Then press Solve. You'll get the shortest solution for your exact position and can play it as an animation or step through it move by move. It is the 3x3 version of our sliding puzzle solver, which handles every size up to 8x8.
How hard is a 3x3 puzzle?
The 3x3 slide puzzle, also called the 8-puzzle, has 8 numbered tiles and one empty space. Those tiles can be arranged in 362,880 ways, but only half of them, 181,440 positions, can actually be solved. That is small enough for a computer to know the exact distance of every single position from the goal. That's why the solver can promise the shortest solution every time.
- Most moves ever needed: 31 single-tile moves (only two positions need that many)
- Typical scramble: about 22 moves
- Solving time: a few milliseconds
If your hand solution took 60 or 80 moves, don't worry. The fewest-move path is very hard for a person to find, which is exactly what the solver is for.
Is my 3x3 puzzle solvable?
For a 3x3 board there is a simple test. Read the tiles row by row, ignore the empty space, and count the inversions, every pair where a bigger number comes before a smaller one. If the count is even, the puzzle is solvable. If it's odd, it isn't. The solver does this for you the moment you finish entering the board. If the count is odd, it shows a warning and a Fix it button that swaps two neighboring tiles.
Tips for solving a 3x3 by hand
- Put tiles 1, 2 and 3 in the top row. Tile 3 is the tricky one. Bring it below its spot first, then rotate it in.
- Solve the left column: tiles 4 and 7, as a pair.
- Cycle the last four tiles (5, 6, 8) around the remaining 2x2 square until they click into place.
Stuck halfway? Enter your current position and let the solver show you the rest. For a larger board, use the 4x4 Sliding Puzzle Solver for numbers or pictures, or the 15 Puzzle Solver for the classic numbered 4x4 puzzle.
A verified shortest solution
This board has a shortest distance of two single-tile moves from the standard ascending goal:
1 2 3
4 0 6
7 5 8
Slide 5 up, then 8 left: 5 ↑, 8 ←. The first move leaves the gap at bottom-centre; the second leaves it at bottom-right. Load this board and press Solve to reproduce both the count and the move list.
This is not just a successful path. The production breadth-first distance table returns distance two for this exact input, and the two legal slides reproduce the goal. Tiles 5 and 8 each start one square from their goal, so their combined Manhattan distance is two. One slide can reduce that sum by at most one; a one-move solution is impossible. This supplies both a solution and a matching lower bound.
The same exact-distance search works against the goal you select. Use More → Edit goal for a different target. The inversion rule and the 31 single-tile move maximum described above refer to the usual ascending, bottom-right-blank target.
For entry mistakes, arrows and replay controls, see how to solve a sliding puzzle. The 8 Puzzle Solver uses the same 3x3 tool with a focus on the classic numbered puzzle.
Frequently asked questions
What is the maximum number of moves for a 3x3 sliding puzzle?
31 single-tile moves. Every solvable 3x3 position can be finished in 31 moves or fewer, and only two positions need all 31. A typical scramble takes about 22 moves.
Is the solution really the shortest?
Yes. For 3x3 boards the solver measures the exact distance of every one of the 181,440 solvable positions, so the move list it gives you can't be beaten.
Is 22 moves a promise for my board?
No. It is the median over all reachable arrangements for the usual goal. Your board can need anything from 0 to 31 single-tile slides.
Why can a nearly solved 3x3 board be impossible?
Swapping only two numbered tiles changes its parity. A small-looking error can be unreachable, so check the entered goal and tile identities first.
Which way do the arrows point?
They describe the numbered tile sliding into the blank. The blank moves in the opposite direction.