Guides

15 Puzzle Solvability: Check Inversions and the Blank Row

Check 15 puzzle solvability by counting inversions and the blank row. Three worked positions explain parity for the standard four-by-four sliding puzzle.

Original illustration: a four-by-four sliding-tile board with one empty square and a glowing tile pair.
Original ProjectGAMR editorial illustration.

Test whether the target is reachable before searching for moves

A 15 puzzle solvability check answers whether legal slides can reach the target arrangement. It does not give the next move or measure how difficult a solvable position will be. This distinction is useful when checking a photographed board, a physical puzzle or an arrangement someone has written down.

Here the board is four by four, containing the numbers 1–15 and one blank. The target places the numbers in reading order with the blank at the lower-right corner. One move slides a horizontally or vertically adjacent tile into that gap. Different targets, wraparound edges or other board sizes require their own rule.

Count inverted pairs while leaving the blank out

Read the numbered tiles across each row, then continue on the next row. Omit the blank entirely. An inversion is a pair in which the larger number appears earlier than the smaller number. Count every such pair, including pairs separated by several tiles; this is not merely a count of neighboring tiles in the wrong order.

For a small counting exercise, the sequence 1, 3, 2, 4 has one inversion: 3 before 2. The sequence 3, 1, 2, 4 has two: 3 before 1 and 3 before 2. These short sequences illustrate counting only; they are not complete 15-puzzle boards.

Add the blank's row counted from the bottom

For this standard 4×4 target, add the inversion count to the blank's row number measured upward from the bottom: bottom row is 1, then 2, 3 and 4. The board is solvable exactly when that sum is odd. Zero inversions alone is not the complete test for an even-width board.

The blank's contribution keeps track of a change that the numbered sequence alone misses. A horizontal slide preserves its numbered order. A vertical slide moves one tile past three numbered tiles, flipping inversion parity, while also moving the blank by one row. Both changes together preserve whether the sum is odd or even.

Compare three positions with the same target

First take the solved arrangement: rows 1–3 contain 1 through 12, and the final row is 13, 14, 15, blank. There are zero inversions and the blank is in bottom-row position 1. The sum is 1, which is odd. A completed board therefore passes the same reachability test as other solvable positions.

Now exchange only 14 and 15, keeping everything else fixed. The final row becomes 13, 15, 14, blank. Its one inversion plus blank-row 1 gives 2, so this position cannot reach the stated target by legal slides. Being visually close to completion does not make it reachable.

A vertical slide shows why the blank row matters

For the third composed position, keep rows 1 and 2 solved, use 9, 10, 11, blank in row 3, and place 13, 14, 15, 12 in row 4. The three inversions are 13 before 12, 14 before 12 and 15 before 12. The blank is two rows from the bottom, so 3 plus 2 equals 5: solvable.

Slide tile 12 upward into the gap and the target is complete. This is a constructed counting example, not a promised New game position. Compare it with the swapped-pair example: the test concerns a mathematical constraint on legal movement, rather than how many squares appear already correct.

Apply the result to the board you are actually playing

ProjectGAMR's implementation, checked October 22, 2026, starts from the target and makes 200 legal shuffle slides. That construction preserves solvability. Its controls accept taps or clicks on adjacent tiles; New game generates another shuffled board. There is no board-import control, and this guide does not ask you to enter its composed examples into the game.

If a handwritten position fails the test, recheck the numbers, the omitted blank and your bottom-row count before trying to solve it. If it passes, you have established reachability, not a shortest route. Keep that result separate from your later strategy and move total.

Keep exploring

FOLLOW THE SOURCE

Sources & further reading

Have a correction? Tell our editorial team.

✦ NICE. YOU LEARNED SOMETHING.
PUT THE IDEAS INTO PLAY

YOUR NEXT MOVE.

15 Puzzle

↗

Slide the pieces and restore the order. Every shuffle is reachable.

LogicSolo

Games, guides & curious things. Press Esc to close.

YOUR LOCAL PLAYER CARD

Small quests.
Real good breaks.

Progress stays in this browser. No accounts, tracking or public leaderboard.