8 Puzzle Solver

Eight numbered pieces, one blank, and a 3x3 board you can enter and replay.

Example board
Mixed up. 8 tiles out of place.0 moves · 0.0 s

Eight refers to the pieces

The 8 puzzle is the classic 3x3 sliding number board. It has tiles labeled 1 through 8 and one blank, giving nine cells in total. Its name counts movable pieces, not rows or columns. An 8x8 puzzle is a much larger board with 63 movable tiles. This distinction matters when choosing a size in the tool or searching for an answer to a numbered game.

The sliding puzzle solver opens with a 3x3 example here. The ordinary goal reads 1 2 3 / 4 5 6 / 7 8 0, where the slashes describe row breaks and zero marks the blank. The 3x3 size page also covers image boards, while this page focuses on the numbered game and the mistakes that arise when recording or comparing its states.

Enter nine positions, including the blank

Select Edit start → Type numbers and copy the cells from the top row to the bottom row. For example, 1 2 3 4 5 6 7 0 8 places the blank between tiles seven and eight in the last row. Entering that board and sliding tile eight left completes the target in one single-tile move. The input accepts spaces or commas, and _ can replace 0 for the blank.

Each number 1 through 8 must appear once. Skipping the blank or repeating a label means the sequence no longer describes a valid board. You can also click two cells in Edit mode to exchange their contents and reproduce a diagram. During actual play, arbitrary exchanges are not allowed: only pieces adjacent to the blank slide into it.

A small board can still hide an impossible input

For the standard ordered target, read the numbered tiles row by row and omit the blank. An inversion is a pair that appears in reversed numeric order. An even total belongs to the reachable group; an odd total does not. Exchanging just tiles seven and eight in an otherwise completed board gives an impossible arrangement for that target, even though it looks almost finished.

The blank can occupy any cell without that alone deciding reachability on a 3x3 board. Its position influences the next available moves, but the odd-width order rule distinguishes the two groups for the standard goal. If your puzzle uses a different target, open More → Edit goal first. The tool compares start and goal directly rather than treating the default arrangement as the only valid finish.

Useful small-board exercises

A one-slide finish is a good way to learn the direction notation: move the labeled tile into the blank and watch which arrow appears. A scramble limited to the bottom two rows is useful for seeing how a blank travels around a small cycle while the top row stays undisturbed. A broadly mixed position introduces a different lesson: reducing one tile's distance can temporarily increase another's, so a sequence is more informative than a single attractive move.

Do not freeze every piece the instant it reaches home. In a compact board, the blank often needs that square to circulate. The replay may deliberately move a correct piece away before restoring it later. Follow the full route and keep your real board synchronized with the displayed step number.

A distance table matched to your goal

For 3x3, the solver explores legal arrangements outward from the chosen goal and records their distances in a table. From an entered reachable state it can then choose moves that decrease the recorded distance until the goal is reached. The table is tied to the target arrangement, so changing the goal changes the problem being solved.

This differs from committing to a fixed row-by-row recipe. The small board allows the solver to work directly with complete states. You do not need to know the table's internal numbering to use it: enter a valid board, press Solve, and inspect the tile-by-tile replay. The 15-puzzle page describes the larger classic numbered game, whose search has a different scale.

Read the route and handle a rejected board

Each move names a tile and shows where that tile slides. If tile six is above the blank and enters it, the arrow points downward; the blank moves upward as a consequence. Move counts are single-tile slides, including when the interface lets you move a line of pieces with one gesture. Use pause, the step controls, and the selected move to translate the answer into another app or a physical puzzle.

An unsolvable banner means no legal slide sequence reaches the selected goal from the entered state. Check the copied numbers and target first. Fix it changes a neighboring tile pair and offers a new reachable board, which is useful for practice but changes the task. You can share the numbered arrangement with Copy link and return to the same board later; a custom goal is part of the shared state when needed.

Frequently asked questions

Is an 8 puzzle an 8x8 puzzle?

No. The 8 puzzle has eight movable tiles in nine cells, so its board is 3x3. An 8x8 board has 63 movable tiles and one blank.

Can I use a goal with the blank first?

Yes. Open More → Edit goal and choose or enter the intended arrangement. The solver checks and solves the starting board against that goal.