15 Puzzle: Sliding Tile Game

Runs in your browser — nothing is uploaded

Slide the numbered tiles into the empty space until they are in order from 1 in the top-left corner, with the space in the bottom-right corner. The 4 × 4 board has 15 tiles, which gave the puzzle its name.

Exactly half of all possible arrangements can never be solved, so each board here is shuffled and then checked with the parity rule, so it can always be solved.

How to use it

  1. Choose a size: 3 × 3 (8 tiles) is quick, 4 × 4 is the classic, 5 × 5 takes patience.
  2. Tap a tile next to the space to slide it. Tapping a tile further along the same row or column slides the whole line at once.
  3. On a keyboard, the arrow keys move the tile beside the space into it.
  4. Tiles already in their correct place turn blue. Your best result is saved for each size.

Common uses

  • A classic logic puzzle to play on a break.
  • Training spatial thinking and planning ahead with children.
  • Showing pupils a real use of parity and permutations.
  • Beating your own best number of moves.

Examples

PositionCan it be solved?
4 × 4 in order, but 14 and 15 swappedNoThe famous “14–15” challenge: one swap changes the parity, so no sequence of moves can fix it.
3 × 3: 1 2 3 / 4 5 6 / 8 7 _NoOne inversion on an odd-width board.
3 × 3: 1 2 3 / 4 5 6 / 7 _ 8Yes, in 1 move
Any board shuffled hereAlways

Frequently asked questions

How do you solve the 15 puzzle?

A common method is to solve it row by row: place 1, 2, 3 and 4 in the top row, then the second row, and finish the last two rows column by column. Placing the last tile of a row usually needs a short loop of moves that temporarily disturbs the tile before it.

Why are some positions impossible?

Every move changes the order of the tiles in a way that keeps a certain parity (based on the number of inversions and the row of the space). Swapping two tiles changes that parity, so a position with two tiles swapped can never be solved.

How are moves counted?

Each tile that slides counts as one move, so sliding three tiles in a row at once counts as three.

Which size should I start with?

Start with 3 × 3 to learn the technique, then move to the classic 4 × 4. The 5 × 5 board uses the same method but takes much longer.