How to play
The 15 puzzle is a square tray of numbered tiles with one empty space. A tile next to the gap can slide into it, which moves the gap. Keep sliding until the numbers read in order from left to right and top to bottom, with the gap in the bottom right corner. On the classic 4×4 board that means 1 to 15. The 3×3 board goes up to 8, the 5×5 board to 24 and the 6×6 board to 35.
Pick a size and press Start. The clock does not run until your first move, so take a look at the board first. Every move counts one point for each tile that slides, so pushing three tiles in one click counts as three moves. When the last tile drops into place, the clock stops and the missing corner tile appears. You see your time and move count, and a badge if you set a new record.
Controls
- Mouse: click any tile in the same row or column as the gap. That tile and every tile between it and the gap slide over together. Tiles that would move light up under the pointer.
- Touch: tap a tile in line with the gap, or swipe. A swipe that starts on a tile in line with the gap and points toward the gap moves that group. Any other swipe moves the tile next to the gap in the direction of the swipe. The page does not scroll while your finger is on the board.
- Keyboard: an arrow key, or W A S D, moves a tile into the gap in that direction. Press → and the tile on the left of the gap slides right. Once you use the keys, small arrows on the tiles around the gap show which key moves which tile.
- Other keys: P or Esc pauses, H switches the colour hint, N starts a new game and F toggles full screen.
A slide takes about a tenth of a second and never holds you up. If you press the next key during a slide, the slide finishes at once and your new move starts straight away.
Pause, colour hint and records
Pause stops the clock and hides the board, so you cannot plan your next moves for free. The game also pauses by itself when you switch to another tab. The colour hint is optional: it turns every tile that already sits in its final place green and adds a small check mark. It helps while you learn, and it does not change the score.
Your best time and your fewest moves are kept separately for each size, so a fast solve and a short solve can come from different games. Records and settings stay in your browser and are not uploaded.
Why every shuffle can be solved
Only half of all arrangements of the tiles can be reached by sliding. To tell the two halves apart, read the board row by row, skip the gap and count the inversions: pairs of tiles where a larger number comes before a smaller one.
- Odd width (3×3, 5×5): a position is solvable exactly when the number of inversions is even.
- Even width (4×4, 6×6): add the row of the gap, counted from the bottom (the bottom row is 1). The position is solvable exactly when this sum is odd.
even width: (inversions + gap row from bottom) is odd
Why? A sideways slide does not change the reading order. An up or down slide makes one tile jump over the width minus one other tiles. With an odd width that is an even number of jumps, so the parity of the inversions never changes. With an even width every vertical slide flips that parity and also moves the gap one row, so the sum stays odd. The game shuffles at random, and if the result lands in the impossible half it swaps two tiles, which always moves it into the solvable half. Then it slides the gap in from the edge, so any arrow key moves a tile on your first turn.
When the puzzle became a craze around 1880, a famous challenge asked players to fix a board with only 14 and 15 swapped. The prizes were safe: one swap flips the parity, so that position can never be solved.
Tips and strategy
- Solve the top row first, then the left column. What is left is the same puzzle one size smaller, so keep going until only two rows remain.
- The last tile of a row is the tricky one. Park it just below its target, move the second last tile into the corner, and bring both in with one turn.
- Finish the last two rows column by column, from left to right, placing both tiles of a column together.
- For speed, use long slides: one click can move up to five tiles on a 6×6 board.
- Every 3×3 position can be solved in 31 moves or fewer, and every 4×4 position in 80 single tile moves or fewer.
Frequently asked questions
Is every board solvable?
Yes. The game checks the parity before you play and never gives you an impossible board.
Sources
- Johnson W W, Story W E (1879). Notes on the “15” puzzle. American Journal of Mathematics, 2(4), 397–404. Only half of all arrangements can be reached by sliding, so a board with only 14 and 15 swapped cannot be solved; an editors’ note in the same issue says the puzzle had lately engaged nine out of ten people.
- Archer A F (1999). A modern treatment of the 15 puzzle. The American Mathematical Monthly, 106(9), 793–799. The famous prize for a position that cannot be solved, and a short proof of the parity rule for solvable boards.
- OEIS Foundation (accessed 27 October 2026). A087725: Maximal number of moves required for the n X n generalization of the sliding block 15-puzzle. The On-Line Encyclopedia of Integer Sequences. At most 31 single tile moves on the 3×3 board and 80 on the 4×4, with references to the computer searches that proved them.