Slide Puzzle Solver

Sliding Block Puzzle Solver

For numbered and picture tile puzzles from 3x3 to 5x5.

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

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

24 moves · Shortest solution

Steps 1–10

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

Steps 11–20

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

Steps 21–24

  1. Step 21: Move 1 up
  2. Step 22: Move 4 left
  3. Step 23: Move 5 up
  4. Step 24: Move 8 left

What counts as a sliding block puzzle

“Sliding block puzzle” gets used for a few different toys and games, so it helps to be clear about which one you have before you reach for a sliding block puzzle solver.

  • Numbered tiles. Square tiles numbered 1 to 8, 1 to 15 or 1 to 24 in a square frame, with one empty space. The 15 puzzle is the best-known example.
  • Picture tiles. Exactly the same mechanics, but the pieces form an image instead of a number sequence.
  • Blocks of different sizes. Puzzles such as Klotski and Rush Hour, where pieces are long, short, large or small and you slide them to free one particular piece.

This tool solves the first two kinds, on square 3x3, 4x4 and 5x5 boards. It does not solve Klotski, Rush Hour or other puzzles with pieces of different sizes, and it does not handle rectangular boards. If your puzzle has equal-sized pieces and one gap, you’re in the right place: the solver above gives you the shortest solution for 3x3 and 4x4 boards and a complete solution for 5x5.

Using the sliding block puzzle solver on picture puzzles

With a picture puzzle there are no numbers to type in, so the tool reads the board from images instead:

  1. Open the upload panel and choose Picture mode, along with the board size.
  2. Upload a screenshot of the scrambled puzzle, then the original image: the game’s preview, or a screenshot of the finished picture.
  3. Drag the four corners so the frame sits exactly on the puzzle. A grid appears inside the frame to help you line it up, even if the photo is taken at an angle.
  4. The tool cuts both images into tiles and matches every scrambled piece to its home in the original. Pieces it isn’t sure about are highlighted.
  5. Check the board, tap any tile to correct it, and press Solve.

Everything happens in your browser; neither image is uploaded anywhere. If your puzzle uses numbers instead, the main sliding puzzle solver lets you type the board in directly, which is often quicker than taking a screenshot.

A short history of sliding block puzzles

The 15 puzzle appeared in the United States in the 1870s, and in early 1880 it became a craze across the US and Europe. Its invention is usually credited to Noyes Palmer Chapman, a postmaster in New York State. Sam Loyd later claimed he had invented it, but that claim doesn’t hold up.

Loyd’s name did become attached to the most famous version: the 14-15 puzzle, a board that is solved except that 14 and 15 are swapped. Loyd claimed to offer $1,000 to anyone who could solve it. Nobody could collect, because the position is impossible. In 1879, Johnson and Story had already proved in the American Journal of Mathematics that half of all starting positions of the puzzle can’t be solved.

That proof is still the first thing to check when a puzzle refuses to come out. The unsolvable sliding puzzle page shows how to test any board in a few seconds, and if you would like to learn the solving method yourself, read how to solve a sliding puzzle.

Frequently asked questions

Can it solve Klotski?

Not at the moment. Klotski uses blocks of different sizes, and this tool only works with puzzles where every piece is the same square size, on 3x3, 4x4 and 5x5 boards. If your puzzle has a large block that has to escape through a gap, it is a Klotski-style puzzle and this solver can't read it yet.

Can it solve Rush Hour?

No. Rush Hour is a sliding block puzzle where long and short pieces slide in their own lanes to free one piece, which is a different kind of problem. This solver handles numbered and picture tile puzzles with one empty square, where any tile next to the gap can slide into it.

How do I solve a picture sliding puzzle with this tool?

Open the upload panel and choose Picture mode. Upload a screenshot of the scrambled puzzle and the original image, such as the game's preview. Drag the four corners to frame the board, check the matched pieces, fix any tile by tapping it, and press Solve. Both images stay in your browser.

What's the difference between a sliding block puzzle and a sliding tile puzzle?

Usually nothing. Most people use both names for the same puzzle: equal-sized numbered or picture pieces and one empty square, which is what this page solves. Some people use "sliding block puzzle" for Klotski-style puzzles with pieces of different sizes, which this tool does not support yet.