Connect 4 Solver — Find the Perfect Move
Drop discs to set up any position, then let a perfect-play engine reveal the best move — and which columns win, lose or draw. Everything runs in your browser, nothing is uploaded.
How to Use the Solver
Click a column to drop a disc — reds and yellows alternate automatically, red first, just like a real game. Recreate the position on your board, then press Find best move. The solver marks the strongest column with a ▼, labels any column that forces a Win or a Loss, and tells you whose move it is analysing. Undo takes back the last disc; Example loads a sample position to try.
How the Solver Works
Connect 4 is a solved game — with perfect play the first player wins by moving in the centre column. This tool plays out the game tree using negamax with alpha-beta pruning and a transposition table over bitboard positions, scoring forced wins and losses exactly and evaluating everything else by threats and centre control. For each legal column it looks ahead many moves, then ranks them from the mover's perspective. It all runs on your device in a fraction of a second, and your board never leaves the browser.
Frequently Asked Questions
How do I set up a position?
Does it play perfectly?
Who moves first?
What do the Win and Loss labels mean?
Is anything uploaded?
Related Solvers & Games
Prefer to play? Take on the AI Connect 4 game. Solving other games? Try the Sudoku Solver or the Minesweeper Solver, or browse all AI solvers & analyzers.
Add This Connect 4 Solver to Your Website
Put the Connect 4 Solver on your own page — free, no sign-up, no watermark. It runs entirely in your visitors' browsers. Copy the snippet and paste it into your page's HTML.