Play the 15 Puzzle Online, the Classic Slide Puzzle

In the 15 Puzzle, fifteen numbered tiles sit in a 4×4 frame with one empty square, and the only thing you can ever do is slide a tile into that gap. Here one tap pushes a whole run of tiles at once, the board comes in four sizes from 3×3 to 6×6, and on the two smaller sizes you can watch the shortest solution play out from wherever you are.

Also known as the sliding puzzle, slide puzzle, Gem Puzzle or Game of Fifteen, it is a different game from Klotski, where ten blocks of different sizes clear a path for one large piece.

15 Puzzle rules and how moves are counted

You win by sliding tiles until they read 1, 2, 3 and onward across each row from the top, with the empty square finishing in the bottom-right corner. Each move slides a tile that shares a row or column with the gap toward the gap. There is no time limit and no way to lose.

Tap a tile two or three squares from the gap and every tile in between moves with it. Each tile that slides counts as one move, so a three-tile push scores three, the same as three single taps. Swiping toward the gap works too, and so do the arrow keys, which move whichever tile would travel that way: Left moves the tile on the gap's right into it.

Timing begins with your first slide and ends as the final tile reaches its square, and switching away from the page pauses the clock. There is no undo button, since sliding the same tile back reverses any move at the cost of the extra moves. Restart returns this board to its starting layout, and New game deals another.

Four board sizes, from the 8 puzzle to 6×6

SizeTilesWhat Hint showsShow the solutionFewest-moves line at the end
3×31–8Next move of a shortest solutionYesYes
4×4 (default)1–15Next move of a shortest solutionYesYes
5×51–24Next step of the row-and-column methodNoNo
6×61–35Next step of the row-and-column methodNoNo

The 3×3 board is usually called the 8 puzzle, and this game never deals one that can be finished in fewer than 16 moves. Choosing a size in the Size row deals a new board.

Can every 15 puzzle be solved?

No. Exactly half of all ways to place the tiles in the frame can never be put in order. Every board dealt here comes from the solvable half: the tiles are shuffled at random, and if the shuffle lands in the other half, two tiles are swapped before you see it.

The reason is parity, which no legal slide can change, so only lifting out two tiles and swapping them crosses from one half to the other. Johnson and Story published the proof in 1879. The best-known case is the 14-15 puzzle, a finished board with only the 14 and 15 reversed.

Counting inversions to check a board by hand

  1. Read the tiles in reading order, skipping the gap.
  2. Count every pair in which a larger number comes before a smaller one. Each pair is an inversion.
  3. On a board an odd number of tiles wide (3×3, 5×5), it can be solved when the inversion count is even.
  4. On an even width (4×4, 6×6), add the gap's row counted from the bottom, with the bottom row as 1. It can be solved when that sum is odd.

In the 14-15 puzzle the only inversion is 15 before 14 and the gap is in the bottom row, so the sum is 1 + 1 = 2, an even number, and the board is impossible.

Is there a 15 puzzle solver here?

Yes on 3×3 and 4×4, from the board in front of you. Show the solution plays a shortest solution move by move, and tapping the board stops it so you can take over. Hint gives only the next move of that line, lighting up the tile without moving it. You cannot enter a position of your own, and on 5×5 and 6×6 the solution button is grayed out.

A finished 3×3 or 4×4 also gets a "Fewest possible" line with the shortest count for that board. It counts moves the same way as your total, so the difference is how far you were from perfect. No 3×3 position needs more than 31 moves, and no 4×4 more than 80, a bound proved in 1999.

How to solve the 15 Puzzle row by row

The method most solvers learn always works and needs only one trick. Each stage finishes the outer row, then the outer column, and leaves a smaller square.

  1. Slide 1 and 2 into the top row, then leave them alone.
  2. Bring 3 and 4 in as a pair. Park 3 in the top-right corner, where 4 belongs, with 4 directly below it, and walk the gap around to the square left of 3. Slide 3 left, then 4 up.
  3. Do the left column the same way: place 5, then put 9 in the bottom-left corner with 13 just right of it and the gap above 9. Slide 9 up, then 13 left.
  4. In the 3×3 that is left, 6 goes in first, 7 and 8 enter as a pair, 10 and 14 as another pair, and then 11, 12 and 15 circle around the gap until they drop into place.

On 5×5 and 6×6 the same steps peel off one outer row and column at a time, and that is what Hint teaches there, with the line above the board reading "Top row first", then "Then the left column", then "Now the last 3×3".

The usual beginner trap is dropping a row's last tile in on its own, which knocks its neighbor back out. The other is breaking a finished row to fetch a tile, when walking the gap the long way around costs far fewer moves. Plan where the gap goes next rather than the tile, since tiles only ever move into the gap.

Fastest time, fewest moves and the Record book

The result card shows your time, moves and moves per second, and for each size the Record book keeps your number of solves, your fastest time and your fewest moves as separate records, since a quick solve is rarely the shortest. A board finished with Hint or Show the solution still counts as solved but never sets a best.

New players start on a three-move tutorial board: tap the glowing 14, tap the 11 one square further along so two tiles slide together, then swipe the 12 up. Play the tutorial brings it back.

15 Puzzle board