Sliding Puzzle: Put the Numbers in Order

Slide tiles into the empty square and arrange the numbers in order from 1. Every shuffled board can be solved.

Last updated: · Prepared by: Aydın Uzunboy

A sliding puzzle is a logic puzzle in which numbered tiles are slid around a board, one empty square at a time, until they are in order. Its classic form has 15 tiles and one gap on a 4×4 board, which is why it is also called the 15 puzzle.

The puzzle appeared in the United States in the late 1870s and became a craze in 1880. It has lived on ever since, both as a toy and as a classic problem studied by mathematicians and computer scientists.

Here you can choose an easy 3×3, the classic 4×4 or a hard 5×5 board. Boards are shuffled using legal moves only, so every shuffled board has a solution.

How do you play the sliding puzzle?

  1. Choose a board size; the tiles arrive shuffled.
  2. Tap or click a tile next to the empty square to slide it into the gap.
  3. Tap a tile further along the same row or column and every tile in between slides together.
  4. On a computer you can also use the arrow keys: the arrow shows which way a tile slides.
  5. The puzzle is solved when the numbers run in order from the top left and the gap sits in the bottom-right corner.

How do you solve a sliding puzzle?

A sliding puzzle is easiest to solve row by row: place the top row, then the second, and when two rows remain, work column by column.

The trick to finishing a row is its last two tiles. Bring the last tile just below its place, put the second-to-last tile in the row’s final square, then rotate the two into position together. Try not to disturb rows you have finished. The final 2×2 corner is completed by cycling the tiles around.

Can every sliding puzzle be solved?

No. Exactly half of all random arrangements cannot be solved — but the puzzles on this page always can.

The reason is a parity rule: swapping two tiles without sliding cannot be achieved by any sequence of moves. Boards here start in order and are shuffled with legal slides only, so a solution always exists.

Sliding puzzle: common questions

Is the sliding puzzle free?

Yes. It is free, with no account or download, and runs in the browser.

Why is it called the 15 puzzle?

Because its classic form has 15 numbered tiles and one gap on a 4×4 board.

Are my records saved?

Your fewest moves and best time are stored in your own browser only, separately for each board size.