Connect Four Solver
Connect Four is a solved game. The first player can always win with perfect play. Explore how the solver works and test yourself against it.
Looking for the actual solver tool?
Mathematically Solved
In 1988, James Allen proved that the first player can always force a win by starting in the center column.
4.5 Trillion Positions
The complete game tree has been computed. Every possible board state has a known outcome.
Play Against Perfection
Our engine uses the full solution database. At max difficulty, it never makes a mistake.
Is Connect Four Solved?
Yes. Connect Four was independently solved by James Allen and Victor Allis in 1988. They proved that with perfect play, the first player always wins by starting in the center column (column 4). If the first player starts anywhere else, the game is either a draw or a second-player win.
In 1995, John Tromp strongly solved the game by computing the exact value of every reachable position. This means for any board state, we know whether it leads to a first-player win, a second-player win, or a draw with best play from both sides.
What Does "Solved" Mean?
A solved game is one where the outcome can be determined from any position, assuming both players play optimally. Connect Four has approximately 4.5 trillion possible positions. The solver has evaluated all of them.
This doesn't mean the game is boring. No human can memorize 4.5 trillion positions. Even the two solvers of the game, when they played each other in 1995, drew their six-game match 3-3. Knowing a game is solved and playing it perfectly are very different things.
How the Solver Works
The engine evaluates positions using alpha-beta pruning with a transposition table built from the complete game solution. At lower difficulty levels, it limits its search depth to simulate human-like play. At maximum difficulty, it accesses the full solution and plays the provably best move in every position.
Frequently Asked Questions
Is Connect Four a solved game?
Yes. Connect Four was independently solved by James Allen and Victor Allis in 1988. With perfect play, the first player always wins by starting in the center column. In 1995 John Tromp strongly solved the game by computing the exact value of every reachable position.
Who solved Connect 4?
James Allen and Victor Allis both solved Connect Four in 1988, working independently. Allis published his result first as part of his 1988 master's thesis at the Vrije Universiteit Amsterdam. John Tromp later strong-solved the game in 1995.
Can the second player win Connect 4?
Only if the first player makes a mistake. With perfect play from the first player's opening center move, the second player can at best draw — and only if the first player slips. If the first player opens anywhere other than the center column, the game becomes a draw or a second-player win with perfect play.
How does the play4row solver work?
The engine combines alpha-beta pruning with a transposition table built from the complete Connect Four solution database. At maximum difficulty it consults the full game-theoretic solution and plays the provably best move in every position. At lower difficulty levels the search depth is limited to mimic human-level play.
Is the play4row solver free to use?
Yes. The solver, the analysis board, and the engine are all free with no signup required. You can play or analyze positions directly in your browser on desktop or mobile.
Test Your Skills
Can you beat a solver that knows every position? Try it and find out.