Skip to content
One Quick Try

Sliding Puzzle

Slide the numbered tiles back into order, 1 to 8 or the classic 1 to 15, with the gap last.

Type
Logic
Takes
about 2-5 min
Result in
moves

Sliding Puzzle

~2-5 min

  1. The tiles are scrambled, with one gap.
  2. Tap a tile in the gap's row or column to slide it in. Arrow keys work too.
  3. Put them back in order, 1 to 8, with the gap last. The clock starts on your first move.
Size

On 3×3 your moves are compared with the fewest possible.

Your result: — moves

How it's measured
  • Traffic Jam

    Slide the cars to free the red one.~2-6 min
  • Tower of Hanoi

    Move every disk in the fewest moves.~1-5 min
  • Lights Out

    Turn off every light. Each press flips its neighbors.~1-3 min
  • Peg Solitaire

    Jump pegs until only one is left.~3-6 min
  • Water Jug

    Measure an exact amount with unmarked jugs.~1-4 min
  • Chinese Rings

    Take every ring off the bar.~2-5 min

How does the sliding puzzle work?

Numbered tiles sit in a square frame with one empty space. Tap a tile in the same row or column as the gap and it slides in, pushing any tiles between them along. Arrow keys slide the tile next to the gap. Put the tiles back in order, 1, 2, 3 and on, with the gap in the bottom-right corner. You can play the 3×3 board, often called the 8 puzzle, the 4×4 board, the classic 15 puzzle, or the 5×5 board, the 24 puzzle.

How is your result calculated?

Your result is the number of moves, counting every tile that moves, so sliding three tiles at once is three moves. The clock starts on your first move. On 3×3, when the tiles are dealt, the site works out the fewest moves that deal could be solved in, and your moves are compared with that number. On 4×4 and 5×5 there are far too many possible positions to do that quickly in a browser, so only your own count is shown.

Why can't every sliding puzzle be solved?

Exactly half of all the ways to arrange the tiles can never be put back in order, however long you slide. Each slide preserves a hidden kind of parity, counted from how many pairs of tiles are in the wrong order, so a board on the wrong side of it can never reach the solved one. William Woolsey Johnson and William Edward Story proved this in 1879, as the 15 puzzle craze was beginning. The best-known impossible position is the solved board with 14 and 15 swapped.

Every deal here is checked to be solvable before you see it. On 3×3 there are 181,440 solvable arrangements, exactly half of the 362,880 ways to place the tiles, and the hardest of them needs 31 moves. The site's tests confirm both numbers by exploring every one of them.

What is the trick to sliding puzzles?

  • Solve one row at a time. Put the top row in place and then leave it alone. On 4×4, do the second row the same way; on 5×5, the second and third.
  • Finish the last two rows column by column. Bring the two tiles of each column into place together, by cycling them around the gap.
  • Place the last tile of a row with a detour. Park it just below its spot, then slide the tile beside it out and back so both drop into line.

For another puzzle about sliding pieces in a tight space, try the Traffic Jam Puzzle; for a puzzle with a proven fewest moves, the Tower of Hanoi.

Questions

Is every sliding puzzle solvable?
No: exactly half of all tile arrangements can't be solved. Every board dealt here is checked to be in the solvable half before you see it.
What are sliding puzzles called?
Sliding tile puzzles. The 3×3 version is the 8 puzzle, the 4×4 the 15 puzzle and the 5×5 the 24 puzzle, named after their number of tiles.
What is the fewest moves to solve a 3×3 sliding puzzle?
It depends on the deal: from a few moves to 31, the most any 3×3 position needs. Your result shows the fewest possible for the deal you played.
How do moves count when I slide several tiles?
Each tile that moves counts as one move, so sliding three tiles in one tap is three moves.
Where does the 15 puzzle come from?
It caused a craze in the United States in 1880. The 1879 proof that half of its positions are unsolvable came out of that excitement.