15 Puzzle Solver

Turn a photo of your 4 × 4 sliding puzzle into a step-by-step solution.

Step 1: Upload Template

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

Choose the empty space, then drag all sixteen tiles from the photo on the left into the solved arrangement on the right, including the blank tile.

For the default example, choose tile 16 (bottom right) as the empty space.

Scramble — drag these tiles
Complete photo — drop tiles here

You can also select a tile and click an empty destination cell, or use Tab and Enter.

Sliding puzzle illustration

How it works

The solver checks whether your arrangement is reachable, then finds a shortest path from your puzzle photo to the complete image you arranged.

A 4 × 4 puzzle has many more arrangements than a 3 × 3 puzzle. Difficult puzzles may reach the 25-second search limit. A timeout does not mean your puzzle is unsolvable.

Check the automatic crop before arranging. If it misses the grid, turn off automatic cropping and upload a photo already cropped to the square board. The uncropped upload is preserved separately as a compressed AVIF.

Iterative Deepening A-star

Explores legal moves within increasing distance limits to find a shortest solution while keeping memory use low.

Tile Distance

Uses Manhattan distance and disjoint linear conflicts to estimate the moves remaining to your complete photo.

Solvability Check

Checks the tile order and blank row before searching for a route to your chosen arrangement.