What Is a FreeCell Solver?
A FreeCell solver is a computer program that analyzes a FreeCell card layout and determines the exact sequence of moves needed to win the game. Unlike human players who rely on intuition, pattern recognition, and experience, a solver uses systematic search algorithms to explore thousands or even hundreds of thousands of possible game states until it finds a path from the starting deal to a fully solved board.
Solvers serve multiple purposes in the FreeCell community. Researchers use them to catalog which deals are solvable and which are not. Competitive players study solver outputs to learn efficient move sequences they might not have considered. Game developers integrate solvers to provide hint systems and to verify that randomly generated deals are actually winnable before presenting them to players.
The solver on this page works entirely in your browser. When you enter a game number, it generates the deal using the same Microsoft-compatible dealing algorithm used by every major FreeCell implementation, then searches for a winning sequence of moves. No data is sent to any server — the entire computation runs locally in a background thread using a Web Worker, keeping the page responsive while the solver works.
How Our Solver Works
Our solver uses the A* search algorithm, one of the most well-known pathfinding algorithms in computer science. A* was first described in 1968 and has since been applied to everything from GPS navigation to game AI. In the context of FreeCell, A* treats each possible board configuration as a node in a graph and each legal move as an edge connecting two nodes.
What makes A* special is its use of a heuristic function — an estimate of how far each game state is from a winning position. Our heuristic considers several factors:
- Cards remaining off foundations — Each card not yet on a foundation pile adds to the estimated distance. With 52 cards in a deck and four foundation piles to build, this is the most direct measure of progress.
- Occupied free cells — Free cells are your most valuable resource. Each occupied cell is penalized more heavily than a card in a column because it directly limits your ability to make multi-card moves.
- Buried foundation candidates — When the next card needed for a foundation pile is trapped beneath other cards in a column, the solver recognizes this as a significant obstacle and increases its distance estimate accordingly.
- Ordered sequences — Columns containing properly alternating-color descending sequences get a small bonus, since these sequences represent organized work that moves the game toward completion.
Beyond the heuristic, the solver employs move ordering to try the most promising moves first. Foundation moves are always tried first (score: 1000), followed by moves that empty a cascade column (80), moves from free cells back to cascades (100), and multi-card sequence moves (50). Moving a card to a free cell is penalized (-50) since it consumes a limited resource.
The solver also performs automatic safe moves. Whenever a card can be safely moved to its foundation — meaning no card of the opposite color with a lower rank could possibly need to be placed on it — the solver makes that move without counting it as a search step. This pruning dramatically reduces the search space.
State deduplication prevents the solver from revisiting board positions it has already explored. Each unique configuration of cascades, free cells, and foundations is hashed into a canonical string. Since free cells are interchangeable (it does not matter which specific cell holds a card), the hash sorts free cell contents before encoding, ensuring equivalent positions map to the same hash.
The Mathematics of FreeCell
A standard 52-card deck can be arranged in 52! (52 factorial) ways — approximately 8.07 × 1067 different orderings. That number is staggeringly large, exceeding the estimated number of atoms in the observable universe by many orders of magnitude.
However, not all of those arrangements produce unique FreeCell deals. The Microsoft dealing algorithm uses a 32-bit linear congruential random number generator (LCG) seeded with the game number. The formula is:
This generator has a period of 231 (about 2.15 billion), meaning it can produce at most that many distinct deals — though in practice the original Microsoft FreeCell only used game numbers 1 through 32,000. The extended numbering goes up to 1,000,000, producing approximately 1.82 × 1064 unique dealing sequences within that range, accounting for structural symmetries.
Each deal distributes 52 cards across 8 columns: the first four columns receive 7 cards each (28 cards), and the last four receive 6 cards each (24 cards). All four free cells and four foundation piles start empty. This fixed structure means the solver needs to navigate from one specific starting configuration out of an enormous state space toward the single winning state where all foundations hold Ace through King of their respective suits.
The state space for a single FreeCell deal — the number of distinct board positions reachable during play — is estimated at roughly 1017 to 1019 positions. Our solver's 300,000-state search limit represents a tiny fraction of this space, yet the heuristic guides it efficiently enough to solve the vast majority of deals within that budget.
The 8 Famous Unsolvable Deals
Of the first 1,000,000 FreeCell deals generated by the Microsoft algorithm, only 8 have been proven completely unsolvable. No sequence of legal moves can win these games, no matter how skillfully you play. This gives FreeCell a remarkable solvability rate of 99.9992%.
The confirmed unsolvable deals are:
Deal #11982 holds a special place in FreeCell history. It was the first deal identified as unsolvable in the original set of 32,000 Microsoft FreeCell deals. For years, players debated whether it could be beaten with the right strategy. The question was ultimately settled by exhaustive computer analysis that proved no winning path exists — every possible sequence of moves eventually reaches a dead end.
The remaining seven unsolvable deals were discovered through large-scale computational sweeps of the extended 1,000,000-deal set. Multiple independent research groups verified these results using different solver implementations, confirming that these 8 deals — and only these 8 — are truly impossible within the first million.
Try entering any of these numbers in the solver above to see the result for yourself. The solver will explore its full search budget and report that no solution could be found.
Solver Algorithms Compared
Several algorithms have been applied to solving FreeCell, each making different tradeoffs between speed, memory usage, and solution quality. Here is how the major approaches compare:
Depth-First Search (DFS)
DFS dives deep into one sequence of moves before backtracking. It uses very little memory since it only needs to track the current path, but it can get stuck exploring long, fruitless branches. Without good pruning, DFS may take an extremely long time or miss solutions entirely. It excels when combined with iterative deepening.
Breadth-First Search (BFS)
BFS explores all states at each depth level before going deeper, guaranteeing it finds the shortest solution. The downside is enormous memory consumption — storing every explored state at every depth level. For FreeCell's large state space, pure BFS is impractical without significant memory optimization.
A* Search (Our Approach)
A* uses a priority queue ordered by f(n) = g(n) + h(n), where g(n) is the number of moves taken and h(n) is the heuristic estimate of remaining distance. This balances exploration breadth with goal-directed efficiency. A* is optimal when the heuristic never overestimates the true distance (admissibility). Our implementation caps exploration at 300,000 states, making it suitable for real-time browser use.
IDA* (Iterative Deepening A*)
IDA* combines A*'s heuristic guidance with DFS's memory efficiency. It performs repeated depth-limited DFS passes, increasing the depth threshold each iteration based on the heuristic. This finds optimal solutions with minimal memory, but the repeated work from restarting each iteration makes it slower than A* for problems where memory is available.
For a browser-based solver where memory is limited but speed expectations are high, A* with a capped search budget offers the best balance. Our solver finds solutions to over 99.99% of solvable deals within its 300,000-state limit.
Can Every FreeCell Game Be Won?
This is one of the most frequently asked questions in the FreeCell community, and the short answer is: almost. The long answer involves decades of computational research, community-driven verification projects, and some fascinating mathematics.
When Microsoft first included FreeCell in Windows 3.1 in 1995, it shipped with 32,000 numbered deals. Players quickly began attempting to solve every single one. The Internet FreeCell Project, a collaborative effort among FreeCell enthusiasts, systematically worked through all 32,000 deals. By 1995, they had solved 31,999 of them. The lone holdout was Deal #11982.
Despite the efforts of thousands of players and the application of early computer solvers, #11982 resisted all attempts. Eventually, exhaustive computational analysis proved that no winning sequence exists — every possible line of play reaches a position where no more moves can be made with cards still remaining.
When researchers extended their analysis to the first 1,000,000 deals, they found only 7 additional unsolvable games, bringing the total to 8 out of 1,000,000. That translates to a solvability rate of 99.9992%, making FreeCell one of the most solvable card games ever created.
It is worth noting that "solvable" and "easy" are very different things. Many solvable deals are extraordinarily difficult, requiring precise sequences of 50 or more moves with no room for error. The statistics page shows how solution difficulty varies across the deal space. Some deals can be solved in under 30 moves, while others require 80+ moves of carefully orchestrated card shuffling.
Beyond the first million deals, the question of solvability remains open. No complete enumeration has been published for deals above 1,000,000, though spot checks and sampling suggest the solvability rate remains consistently above 99.99%.
Using a Solver to Improve Your Play
One of the most effective ways to get better at FreeCell is to study how a solver approaches deals you struggled with. Rather than just looking at the answer, pay attention to the patterns and principles the solver demonstrates.
Notice when the solver avoids free cells. A common beginner mistake is using free cells too aggressively. Watch how the solver often finds ways to move cards between columns without touching the free cells at all. When it does use a free cell, notice how it usually frees the card again within just a few moves.
Study the solver's opening moves. The first 5-10 moves in a FreeCell deal often determine whether the rest of the game will flow smoothly. The solver typically starts by uncovering Aces and Twos, building alternating-color sequences, and keeping as many columns accessible as possible. Compare this with your own opening tendencies.
Look for multi-card sequence moves. The solver frequently moves groups of cards between columns in a single logical step. Understanding the supermove mechanic — where the number of cards you can move at once depends on empty free cells and empty columns — is critical for playing efficiently.
Try Ghost Mode for a more visual experience. Instead of reading a list of moves, you can use our Ghost Mode feature in the main game to watch the solver play through a deal with animated card movements. This makes it much easier to see the flow of the solution and understand how each move connects to the next.
The best approach is to attempt a deal on your own first, and only consult the solver when you are truly stuck. After seeing the solution, try the deal again from scratch using the strategic principles you observed. Over time, you will internalize the patterns and find yourself reaching for the solver less and less.
Frequently Asked Questions
How does the FreeCell solver work?
Our solver uses an A* search algorithm with heuristic scoring. It explores game states by trying different moves, prioritizing those most likely to lead to a solution — like moving cards to foundations or freeing up cells. It can search up to 300,000 states to find a winning sequence of moves.
Can the solver solve every FreeCell deal?
Almost. Of the first 1,000,000 FreeCell deals, only 8 are proven unsolvable: #11982, #146692, #186216, #455889, #495340, #512118, #517776, and #781948. That means 99.9992% of all deals have a solution.
How long does it take to solve a deal?
Most deals are solved in under a second. Easy deals may take just 50-100 milliseconds, while harder deals that require exploring more game states can take a few seconds. The solver runs in a background thread so the page stays responsive.
What do the move descriptions mean?
Each move shows the card being moved, where it comes from, and where it goes. For example, '4♠: Column 3 → Free Cell' means move the 4 of Spades from the third column to a free cell. Moves marked with (+N) are multi-card sequence moves.
Why does the solver show fewer moves than I expected?
The solver only counts 'player moves' — deliberate decisions. Safe auto-moves to foundations (like moving an Ace when it becomes available) are performed automatically and counted separately as 'total moves including auto-moves.'
Is using a solver cheating?
That depends on your perspective. Many players use solvers as learning tools — studying how an algorithm approaches a deal teaches you patterns and strategies you can apply to your own games. Our solver page is designed for learning and exploring, not just getting answers.
What is the difference between A* and other solver algorithms?
A* combines the thoroughness of breadth-first search with the speed of greedy best-first search. Unlike DFS (which can go down wrong paths) or BFS (which uses too much memory), A* uses a heuristic to estimate how close each state is to winning, letting it find solutions faster while exploring fewer dead ends.
Can I play a deal after seeing its solution?
Yes! After solving a deal, click the 'Play Deal' link to jump straight into that game. You can also use Ghost Mode in the game to watch the solver play in real time with animated card movements.