Slide Puzzle Solver

Sliding Puzzle Solver

Enter your board or upload a screenshot — get every move, step by step.

Click a cell and type its number. Use arrows to focus, Backspace to clear, Enter to solve. Separate two-digit tiles with a space.

Solvable

Inversions: 0 (counting out-of-order nonblank pairs); an even count is required for an odd-width board.

Example: a solution for this board

72583416
Initial example board. Follow every move below to reach the solved position.

20 moves · Shortest solution

Steps 1–10

  1. Step 1: Move 2 right
  2. Step 2: Move 7 right
  3. Step 3: Move 5 up
  4. Step 4: Move 8 left
  5. Step 5: Move 1 up
  6. Step 6: Move 4 right
  7. Step 7: Move 8 down
  8. Step 8: Move 1 left
  9. Step 9: Move 7 down
  10. Step 10: Move 5 right

Steps 11–20

  1. Step 11: Move 1 up
  2. Step 12: Move 7 left
  3. Step 13: Move 4 up
  4. Step 14: Move 8 right
  5. Step 15: Move 7 down
  6. Step 16: Move 4 left
  7. Step 17: Move 5 down
  8. Step 18: Move 2 left
  9. Step 19: Move 3 up
  10. Step 20: Move 6 up

This sliding puzzle solver takes the board you’re stuck on and gives you every move to finish it. Enter the tiles, press Solve, and follow the list or the replay on your own puzzle.

How this sliding puzzle solver works

There are three ways to enter a board. Tap a square and type its number (arrow keys move between squares). Paste the numbers as text, row by row, such as 1 2 3 / 4 5 6 / 7 0 8, where 0 or _ marks the blank. Or upload a screenshot or photo: the image is read in your browser, and you check the detected board and fix any tile before solving.

Each board size uses its own search:

  • 3x3: A* search, which always finds the shortest solution.
  • 4x4: IDA* with a pattern database, also shortest. In the rare case it runs out of time, you get a complete solution that is clearly labelled as not the shortest.
  • 5x5: solved layer by layer, which is complete and correct but not guaranteed shortest.

“Shortest” means the fewest single-tile moves. The answer comes as a numbered list such as “Move 6 left”, grouped in tens, plus a compact U/D/L/R line you can copy and a replay with previous, next and autoplay.

Is my sliding puzzle solvable?

Exactly half of all arrangements can never be solved, no matter how you slide the tiles. You can tell which half a board is in by counting inversions: read the tiles left to right, top to bottom, skipping the blank, and count every pair where a larger number comes before a smaller one.

On a board with an odd width (3x3 or 5x5), an even count means solvable. On a 4x4, add the blank’s row counted from the bottom (the bottom row is 1); the board is solvable only if that total is odd.

The solver runs this check before searching. If the board is impossible, it shows the count and suggests two tiles to swap, since swapping any two tiles other than the blank flips the result. There is a full walkthrough on the unsolvable sliding puzzle page.

Works with slide, tile and picture puzzles

Whatever your game calls it, this is the same puzzle: a square frame, numbered or picture pieces and one empty square. That makes this tool a slide puzzle solver, a tile puzzle solver and a sliding tile puzzle solver all at once, for 3x3, 4x4 and 5x5 boards.

It also works as a sliding picture puzzle solver. In Picture mode you upload the scrambled puzzle and the original image, and the tool works out where each piece belongs. The sliding block puzzle solver page explains picture mode in more detail, and which puzzles are not supported: Klotski, Rush Hour and other puzzles with blocks of different sizes.

If you’d rather learn the method yourself, read how to solve a sliding puzzle. To follow a solution on a real puzzle one move at a time, with a diagram for every move, use the sliding puzzle solver step by step.

Choose your board size

3x3 sliding puzzle solver

8-puzzle: Shortest solutions, with even the hardest board needing at most 31 moves.

4x4 sliding puzzle solver

15 puzzle: Find the shortest route for the classic puzzle; the hardest boards need 80 moves.

5x5 sliding puzzle solver

24 puzzle: Complete layer-by-layer solutions; the maximum shortest distance is unknown.

play sliding puzzle

Play a sliding puzzle with numbers or your own photo, and ask the solver for help when you get stuck.

Frequently asked questions

Does it always find the shortest solution?

For 3x3 and 4x4 boards, yes. In rare cases a 4x4 search runs past its time limit; the solver then gives a complete solution that isn't the shortest and labels it clearly. For 5x5 boards, the answer is no: the layer-by-layer method always produces a correct solution, but not necessarily the shortest one.

What does "unsolvable" mean?

It means no sequence of slides can ever reach the finished board. Exactly half of all possible arrangements are like this, because every move keeps the tiles' parity the same. If the solver says your board is unsolvable, first check that you entered every tile correctly. If you did, swapping any two tiles (not the blank) makes it solvable.

Can I upload a screenshot or photo?

Yes. Open the upload panel, pick Numbers or Picture mode, and add a screenshot or a photo of your puzzle. Drag the four corners to frame the board, and the tool reads each tile. You then see the detected board and can fix any tile with a tap before you press Solve.

Is my image uploaded anywhere?

No. Your image is read and processed inside your browser and is never sent to any server. The solving happens on your device too. Nothing about your puzzle leaves your computer or phone, and you don't need an account to use any part of the site.

How many moves can a sliding puzzle take?

A 3x3 puzzle never needs more than 31 moves, and a 4x4 needs at most 80, counting each single-tile slide as one move. For 5x5 boards nobody knows the exact maximum. Whatever the size, the solver shows the exact move count for your board before you start.