A 15 puzzle with numbered tiles and one gap, tile 11 sliding into it, between Pip and Gus

Sliding Puzzle Race

Sliding Puzzle Race is the classic sliding puzzle for two players, and a race. You both get the same scrambled puzzle: numbered tiles in a frame with one empty space. Slide the tiles one at a time into the gap until they're back in order, 1, 2, 3 and on, with the gap in the bottom right corner. Whoever finishes first wins. Choose the famous 15 puzzle (4 × 4), the smaller 8 puzzle (3 × 3) or the big 24 puzzle (5 × 5), with numbers or a picture. Play a friend on one phone, tablet or computer, or race the computer at four levels.

Computer level
Puzzle
Tiles
  • 2 players
  • 10-second to 5-minute races
  • Tap a tile in line with the gap, or swipe, to slide it

How to play Sliding Puzzle Race

  1. The puzzle. A frame holds a grid of tiles with one space left empty: 8 tiles on a 3 × 3 puzzle, 15 on a 4 × 4 and 24 on a 5 × 5. Both players get the same scramble (taking turns, the second player gets it turned over, as explained below).
  2. Slide a tile. Only a tile next to the gap can move, by sliding into it. Tap a tile beside the gap and it slides across.
  3. Slide a whole line. Tap any tile in the same row or column as the gap and every tile between them slides along together. Each tile that moves counts as one move.
  4. The goal. Put the tiles in order, left to right and top to bottom: 1, 2, 3 along the top row, and so on, with the gap in the bottom right corner. Tiles in their own place light up in your colour.
  5. The winner. The first player to finish wins, and the moves counter shows how many slides each of you made. Only time counts, not moves. If you both finish at the same moment, to a hundredth of a second, the race is a draw.
  6. Always solvable. Every scramble can be solved. Half of all the ways to put the tiles in a frame can never be solved, whatever you do, so the game only deals scrambles from the other half (see the questions below).
  7. Numbers or a picture. With Picture tiles, each tile is a piece of one of the pictures from our games, and you put the picture back together. Each picture tile keeps a small number in its corner, so you can still solve it in order. The last piece appears when the picture is whole.

Two players on one device

Before a race between two people, choose how you want to play:

  • At the same time. Each of you has your own puzzle. On a phone or a tall tablet they're one above the other, and the top one is turned round to face the player opposite, so you can play across a table. On a wider screen they sit side by side. With one keyboard, Orange uses W, A, S and D and Purple the arrow keys.
  • Taking turns. One player solves the puzzle while the other looks away, then passes the device over. The second player gets the same scramble turned over its diagonal, so the first row becomes the first column: exactly as hard, but nothing they saw over the first player's shoulder helps. They have to beat the first player's time. The clock shows both times, and the race ends as soon as the second player finishes or runs past the time to beat.

Playing at the same time suits a touch screen. With one mouse, taking turns is better, and the game remembers which way you chose last time.

Controls

  • Tap a tile in the gap's row or column to slide it, and every tile between it and the gap, into the gap.
  • Swipe anywhere on your puzzle, even starting on a tile, to push a tile that way: swipe left and the tile to the right of the gap slides left. Keep your finger moving to push one tile after another.
  • Keyboard: each arrow key (or W, A, S, D) pushes a tile that way into the gap. Press the left arrow and the tile to the right of the gap moves left.
  • Puzzle size: choose 3 × 3, 4 × 4 or 5 × 5 before you start. The tiles have to stay big enough to tap, so on a very small screen the game may use a smaller puzzle than you chose, and says so.

Computer levels

Against the computer you both solve the same scramble at once, and its small puzzle sits above yours (beside it on a wide screen), so you can watch how it's getting on. It solves the puzzle the way people learn to.

It works row by row and column by column: first the top row, then the left column, then the next row, and so on, until only a small corner is left. The last two tiles of each row and column always go in together, the trick every sliding puzzle solver has to learn. The higher levels look further ahead: Hard places tiles two at a time and finishes the last 3 × 3 in the fewest possible moves (on the small 3 × 3 puzzle it solves the way Medium does, only quicker), and Expert places them three at a time and also tries the columns first, keeping whichever way is shorter. Before each group of tiles it stops to look, and the lower levels sometimes slide the wrong way for a few moves and have to sort it out.

These are the middle times we measured over thousands of races between computer players, on 3 × 3, 4 × 4 and 5 × 5:

  • Easy: slow and careful, with the odd wrong turn. About 40 seconds, 2 minutes and over 4 minutes, and about 100 moves on 4 × 4.
  • Medium: quicker, with the same method. About 25 seconds, 1 minute 10 seconds and 2½ minutes.
  • Hard: quick, and plans two tiles at a time. About 18 seconds, 45 seconds and 1½ minutes, and about 80 moves on 4 × 4.
  • Expert: very quick and efficient, about 70 moves on 4 × 4. About 11 seconds, 25 seconds and a minute.

We didn't measure how fast real people slide, so Expert's pace is our estimate of a quick, practised player.

Tips to win

  • One row at a time. Put the top row in first, then the left column. What's left is a smaller puzzle of the same kind, and you never need to touch the tiles you've finished.
  • The last two of a row go in together. On a 4 × 4, put the 4 where the 3 belongs and the 3 just below it. Then bring the gap to the top right corner, slide the 4 across and the 3 up. Putting them in one at a time always knocks the other one out. Finish a column the same way, turned on its side.
  • Move the gap, not the tile. Think about where the gap needs to be. To move a tile one step, bring the gap round to the side you want it to go, then slide the tile in.
  • Slide whole lines. One tap on a tile far from the gap slides the whole line in one go.
  • Don't undo. Sliding a tile straight back where it came from wastes two moves. If you're not sure, stop and look before you slide.
  • Start small. The 3 × 3 puzzle never needs more than 31 moves and is a good place to learn the corner trick.

Questions

What is the 15 puzzle?

The 15 puzzle is a sliding puzzle with 15 numbered tiles in a 4 × 4 frame and one empty space. You slide tiles into the space until they're in order from 1 to 15. The same puzzle on a 3 × 3 frame, with 8 tiles, is often called the 8 puzzle, and on 5 × 5 the 24 puzzle.

Who invented the sliding puzzle?

The 15 puzzle is credited to Noyes Palmer Chapman, a postmaster in Canastota, New York. Copies were being made and sold in Boston by December 1879, and it became a craze across the United States in 1880. The famous puzzle maker Sam Loyd later claimed he had invented it, but he had nothing to do with it: his first article about the puzzle came out in 1886, and he first claimed it in 1891.

Why can't some sliding puzzles be solved?

Every slide swaps the gap with one tile, and that changes two things at once: the order of the tiles flips between "even" and "odd" (as mathematicians count swaps), and the gap's distance from its corner goes up or down by one. The two always change together, so a puzzle with the wrong mix can never reach the solved position. Two American mathematicians, William Johnson and William Story, proved in 1879 that exactly half of all arrangements are like that. Sam Loyd later wrote that he had offered $1,000 to anyone who could solve the 15 puzzle with only the 14 and 15 swapped, which is impossible. In Sliding Puzzle Race every scramble comes from the solvable half: we shuffle the tiles at random, and if the shuffle lands in the wrong half, we swap two tiles, which moves it to the right one.

How many moves does the 15 puzzle need?

Every solvable 15 puzzle can be solved in 80 moves or fewer, counting each tile that slides as one move, and every 8 puzzle in 31. Finding the very shortest solution is hard even for a computer, so people solve it with a method instead, row by row, which takes more moves than that: our computer players take about 70 to 100 on a 4 × 4.

Can young children play?

Yes. Choose 3 × 3 with Picture tiles: there are only eight tiles, the picture shows where each one belongs, and the small numbers help too. Race the Easy computer, which takes its time.

Does the computer cheat?

No. There's nothing hidden in a sliding puzzle, and the computer solves its own copy of the same scramble, one slide at a time, at its level's pace. You can watch every move it makes on its small puzzle.

Updated 20 November 2026