Advertisement
Loading...
Moves
0
Time
0:00
1
15
6
2
3
4
7
10
13
11
14
9
5
12
8

Use arrow keys or click tiles adjacent to the empty space to play

Tiles with a colored border are already in their correct position

Advertisement
Loading...

How to Play the Sliding Puzzle

1

Choose Your Difficulty

Select Easy (3×3, 8 tiles), Classic (4×4, 15 tiles), or Hard (5×5, 24 tiles) using the buttons above the board. The game immediately shuffles to a new solvable configuration for the selected size.

2

Slide Tiles Into the Empty Space

Click or tap any numbered tile that is directly adjacent (up, down, left, or right) to the empty space to slide it. On desktop, use arrow keys — the arrow moves the empty space in that direction. On mobile, swipe on the board to move tiles.

3

Arrange All Tiles in Order

Your goal is to arrange all tiles in ascending order — 1, 2, 3, … across each row from left to right, top to bottom — with the empty space in the bottom-right corner. Tiles with a highlighted border are already in their correct position.

4

Beat Your Personal Best

When you solve the puzzle, your move count and time are saved as your personal best for that grid size. Start a New Game anytime to try again. Challenge yourself to solve with fewer moves each time.

Frequently Asked Questions

Why is the puzzle always solvable?

Many sliding puzzle implementations shuffle by generating a random tile arrangement, but exactly half of all possible arrangements are mathematically unsolvable — meaning no sequence of valid moves will ever produce the solved state. Our game avoids this entirely by using a construction-based shuffle: we start from the perfectly solved board and apply hundreds of random valid moves. Because every step in the shuffle is a legal slide, the result is always reversible and therefore always solvable. You will never be stuck with an impossible puzzle.

What do the arrow keys do?

Arrow keys control the movement of the empty space, not a specific tile. Pressing the Up arrow moves the empty space upward — which means the tile directly below the empty space slides up into it. Pressing the Right arrow moves the empty space right — so the tile to the left of the empty space slides right. This convention is used by most sliding puzzle implementations and matches the physical intuition of sliding puzzle boards. You can also use W, A, S, D keys as an alternative to arrow keys.

How are move counts and times tracked?

The move counter increments by one each time a tile successfully slides into the empty space. The timer starts the moment you make your first move on a new game and stops when you solve the puzzle. Both are reset to zero when you start a New Game. Your best result (fewest moves, and fastest time if moves are tied) for each grid size — 3×3, 4×4, and 5×5 — is saved locally in your browser's localStorage. These personal bests persist across browser sessions until you clear your browser data.

What strategy should I use to solve the 4×4 puzzle efficiently?

The most effective strategy for the 15-Puzzle is to solve the board row by row, starting from the top. First, place tiles 1 and 2 into their correct positions in the top row, then tiles 3 and 4 together using a specific rotation cycle. Next, solve the second row (tiles 5–8) the same way. Once the top two rows are complete, focus on the remaining 2×4 section, solving column by column from left to right. Tiles that are close to their target positions should be moved there carefully using small cycles that do not disturb already-solved rows. Practicing on the 3×3 first builds the intuition needed for larger grids.

Can I play the sliding puzzle on a mobile phone?

Yes. The game is fully mobile-optimized. On touch screens, simply tap a tile that is adjacent to the empty space to slide it. You can also swipe on the board in the direction you want the empty space to move — swipe up to move the empty space up (sliding the tile below it upward), swipe right to move the empty space right, and so on. The board automatically resizes to fit your screen. For the best experience on small screens, we recommend starting with the Easy 3×3 mode, which has larger tiles and is easier to tap accurately.

What is the minimum number of moves to solve each puzzle size?

The minimum number of moves (optimal solution length) varies by configuration. For the 3×3 (8-Puzzle), the maximum over all configurations is 31 moves (God's number for the 8-Puzzle), but most typical shuffles require 20–25 moves optimally. For the 4×4 (15-Puzzle), the maximum is 80 moves, and average random shuffles optimally require about 52 moves — but most human solvers use 60–120 moves. For the 5×5 (24-Puzzle), finding the optimal solution is computationally expensive; typical human solutions range from 80 to 200+ moves. Improving your move count is a good measure of how well you understand sliding puzzle techniques.