Sliding Puzzle Strategies:
Algorithms for the Classic 15-Puzzle

For 140 years, the sliding puzzle has driven people mad. Tiles slip into place, then chaos returns. You get close—maybe the top row looks right—and then one wrong move unravels everything.
But here is what most people never discover: there is a method.
Not intuition. Not luck. A repeatable, learnable algorithm that works every single time on every solvable configuration. The puzzle that once took an hour? Three minutes. The puzzle that seemed impossible? Systematic certainty.
Watch the Tutorial
Prefer watching? This quick tutorial covers the basics of Sliding Puzzle.
Prerequisites
This guide builds on concepts from our beginner's guide—understanding basic sliding puzzle rules and how tiles move around the empty space.
The Row-by-Row Method: The Foundation of All Solving
Every reliable sliding puzzle strategy builds on one principle: solve from top to bottom, and never disturb completed work.
Instead of thinking about all 15 tiles at once, you focus on just 4 at a time. Once those 4 are correct, they become invisible—locked in place, never to move again.
Solving Order for a 4x4 Puzzle
- First row: Position tiles 1, 2, 3, 4 (left to right)
- Second row: Position tiles 5, 6, 7, 8
- Left column of bottom half: Position tiles 9 and 13
- Remaining 2x3 section: Position tiles 10, 11, 12, 14, 15
The power of this method lies in progressive simplification. A 4x4 puzzle has 15 tiles to manage. After completing the first row, you effectively have a 3x4 puzzle with 11 tiles. After the second row, just a 2x4 with 7 tiles. The problem shrinks with each phase.

Notice the top row forms a perfect 1-2-3-4 sequence while the bottom three rows remain scrambled—that contrast is exactly what success looks like after phase one.
Positioning the First Row: Getting 1, 2, 3, 4 in Place
Placing Tile 1
Start by finding tile 1 wherever it lurks in the scrambled grid. Your goal: get it to the top-left corner without worrying about anything else.
The key insight: move the empty space, not the tile. To slide tile 1 into a new position, first maneuver the empty space next to it. Then slide tile 1 into the gap.

Tile 1 is now anchored in the top-left corner. Other tiles will shuffle around chaotically—ignore them for now.
The Corner Technique for Tile 4
Here is where beginners often stumble. Tile 4 needs to go in the top-right corner, but sliding it directly into position often disrupts tiles 1, 2, or 3. The solution: the corner rotation technique.
Instead of placing tile 4 directly, set up a specific configuration: position tile 4 directly below its target spot, then rotate the corner section to drop it into place.

The corner technique setup: tile 4 waits just below its destination, with the empty space positioned as a doorway ready for the rotation.
Your First Algorithm
The corner technique is your first "algorithm"—a memorized sequence of moves that accomplishes a specific goal regardless of surrounding chaos. Master it here, because you will use it repeatedly throughout every solve.
Second Row Strategy: Same Method, Tighter Space
With the first row complete, you now have a 3x4 working area for tiles 5, 6, 7, and 8. The approach is identical: work left to right, use the corner technique for the final tile.
The critical discipline: never move tiles 1, 2, 3, or 4. They are furniture bolted to the floor. When you need to maneuver the empty space, route it through rows 2, 3, and 4 only.

Two rows done. Eight tiles locked. You are now working with a 2x4 strip containing just 7 tiles plus the empty space.
Think of it like peeling an onion—each layer you remove reveals a simpler challenge underneath. The intimidating 15-tile puzzle has become a manageable 7-tile puzzle.
The Bottom Half Endgame: Working the Final Two Rows
First, Solve the Left Column
Before tackling the final 2x3 section, position tiles 9 and 13 in the left column of the bottom half. This further reduces your working area.
Finding and placing tile 9 should feel familiar by now. Then comes the corner technique again—but this time applied vertically. Position tile 13 below tile 9, and rotate to lock them both in place.

Notice the left column now forms a complete vertical line: 1, 5, 9, 13. The working area has shrunk to just that 2x3 rectangle on the right.
The Final Rotation Zone
This final section is where the magic happens. Six cells. Five tiles. One empty space. And a technique so reliable that once you internalize it, no configuration in this section can defeat you.
Think of this zone as a tiny dance floor. The tiles are dancers moving in a circle, and the empty space is the spotlight they take turns stepping into. By sliding tiles in a loop, you can cycle through configurations until the correct one appears.

The rotation follows a pattern: slide right, slide down, slide left, slide up. This cycles tiles through all positions in a predictable sequence.
The Rotation Pattern
In a 2x3 zone with one empty space, there are exactly 360 reachable arrangements. By rotating systematically, you will cycle through these configurations until you reach the solved state.
For a typical scrambled final section, 3-6 complete rotations will reach the solution.
The 2x2 Final Rotation: One Algorithm, Used Forever
Sometimes the 2x3 section reduces further to a 2x2 corner—just tiles 14, 15, and the empty space in the bottom-right four cells. When this happens, you have reached the simplest endgame in sliding puzzles.

A 2x2 section with three tiles and one empty space can be solved by pure rotation. There are only three possible wrong configurations, and rotating cycles through all of them.
The 2x2 Algorithm
- • If tiles are one step clockwise from solved: rotate counter-clockwise once
- • If tiles are two steps from solved: rotate counter-clockwise twice (or clockwise once)
After at most two rotations, the puzzle is solved. This is the finishing move you will use on every single 15-puzzle you ever solve.

The goal state: all tiles 1-15 in order, empty space in the bottom-right corner.
When It Is Unsolvable: The Parity Problem
Here is a secret that could save you hours of frustration: exactly half of all random 15-puzzle configurations are mathematically impossible to solve.
No amount of sliding will ever fix them. You could slide tiles for a thousand years, and the puzzle would never reach the goal state. This is not a skill issue—it is mathematics.

The famous Sam Loyd prize puzzle—only tiles 14 and 15 are swapped, but it can never be solved.
The Solvability Rule
For the classic 15-puzzle (4x4 grid) where the solved state has the empty space in the bottom-right corner:
- Count all inversions in the starting configuration (pairs where a larger number appears before a smaller one)
- Find which row the empty space occupies (counting from the bottom, starting at 1)
- Add the inversion count and the empty space row number
- If the sum is even, the puzzle is solvable. If odd, it is impossible.
The good news: every puzzle generated by proper software (including our collection) is guaranteed solvable. The parity check only matters when someone physically scrambles tiles by hand or when you encounter a random configuration online.
Speed Solving Tips: Reducing Moves Once You Know the Method
Look Ahead, Not At
Beginners stare at the tile they are currently moving. Fast solvers look at where tiles need to go next. While sliding tile 5 into position, they are already planning the path for tile 6.
This "look ahead" habit transforms sequential solving into parallel processing. Your hands execute the current move while your brain queues the next three.
Practice the Corner Technique Until It Is Automatic
The corner insertion move appears four times in every solve (tiles 4, 8, and twice in the bottom section). Any hesitation here costs time. Practice the corner technique in isolation until your fingers know it without conscious thought.
Progression Benchmarks
- Beginner: 5-10 minutes per solve
- Competent: 2-3 minutes per solve
- Skilled: Under 1 minute per solve
- Expert: Under 30 seconds per solve
Many people see these improvements within a week of regular practice.
Larger Grids: Scaling the Technique for 5x5 and Beyond
The beautiful thing about the Row-by-Row method: it scales perfectly to any grid size.

Same technique, scaled up. The method remains identical; only the duration changes.
The 5x5 (24-Puzzle)
A 5x5 sliding puzzle contains tiles 1-24 plus one empty space. The solving approach:
- First row: tiles 1, 2, 3, 4, 5
- Second row: tiles 6, 7, 8, 9, 10
- Third row: tiles 11, 12, 13, 14, 15
- Left column of remaining section: tiles 16 and 21
- Final 2x4 section: tiles 17-20, 22-24
Common Mistakes and How to Fix Them
Mistake 1: Disturbing Completed Rows
Fix: Before every move, consciously check which rows are locked. Route the empty space around completed rows, never through them.
Mistake 2: Skipping the Corner Technique
Fix: Always use the corner technique for row-ending tiles. Position the tile below its target, then rotate.
Mistake 3: Random Sliding in the Endgame
Fix: The final section has finite configurations. Systematic rotation will cycle through all of them. Trust the process.
Mistake 4: Solving in the Wrong Order
Fix: Resist the temptation to jump ahead. The Row-by-Row method works because it creates stable progress. Trust the order.
Quick-Reference Solving Order
- Top row: 1, 2, 3, 4 (corner technique for 4)
- Second row: 5, 6, 7, 8 (corner technique for 8)
- Left column of bottom: 9 and 13
- Final 2x3 section: rotate until solved
- Place target tile directly below its destination
- Rotate to drop it into the corner
- Never slide directly into row-end positions
- Count inversions in the tile sequence
- Add the row number of empty space (from bottom)
- Even sum = solvable, Odd sum = unsolvable
Start Solving with Certainty
You now possess what generations of frustrated puzzle solvers never learned: a systematic method that works every time.
The algorithm is straightforward. Row by row, tile by tile, the chaos resolves into order. The corner technique handles the tricky bits. The parity check ensures you never waste time on impossibilities. And the 2x2 rotation finishes every puzzle with satisfying certainty.
The puzzle that stumped an entire generation is about to become your new party trick.
Tiles waiting. Gap ready. Algorithm loaded. Slide with confidence.
Ready to Master the Classic?
The algorithm is in your head. The technique is in your muscles. All that's left is to feel the tiles slide into their perfect positions.
Start Sliding