8 Puzzle Solver

AI-powered puzzle solver, let you find the solution of the sliding 8-puzzle in just a second.

Step 1: Upload Template

To get started, upload your image template or take a photo below.

Want to give it a try? Slide the tiles and see if you can solve it.

Step 2: Arrange Puzzle to Solve

Which tile is the empty space?
Click or tap that tile in the photo below.
No tile selected

First, click or tap the tile that represents the empty space. Then drag and drop all nine tiles from the photo on the left into the solved arrangement on the right. For the default example, choose tile 9 (bottom right) as the empty space.

1
2
3
4
5
6
7
8
9
Scramble — drag these tiles
Complete photo — drop tiles here

How it works

The solver checks whether your arrangement is reachable, then uses A-star search to find a shortest path from your puzzle photo to the target you arranged.

star
A-star Search Algorithm

Explores promising moves first and keeps track of visited arrangements to find a shortest solution.

call_split
Tile Distance

Measures how far each tile is from its target cell using horizontal and vertical distance to guide the search.

text_rotate_vertical
Solvability Check

Checks whether the chosen blank and tile arrangement can be reached through legal sliding moves before searching.