BrowserTools
Home / Entertainment / Connect Four, Play Against the Computer

Connect Four, Play Against the Computer

Play Connect Four online for free, against a computer opponent with three difficulty levels or a friend in local two player mode. No download needed.

Loading Connect Four, Play Against the Computer… If nothing happens, please enable JavaScript.

Connect Four is one of the most recognisable strategy games in the world, a deceptively simple duel played on a vertical board of seven columns and six rows. Milton Bradley published it in 1974, based on a design credited to Howard Wexler and Ned Strongin, and it quickly became a fixture in living rooms everywhere. The concept is older than the plastic version, though: variations on the "four in a row" idea circulated for decades under names like Captain's Mistress, and the gravity twist (discs always fall to the lowest free slot in a column) is what separates it from paper games such as tic-tac-toe and gives it real tactical depth.

Frequently asked questions

How do I play Connect Four?
Click or tap any of the seven columns to drop a disc into it; the disc falls to the lowest empty cell. You and your opponent alternate turns, and the first to connect four discs of the same colour in a row (horizontally, vertically or diagonally) wins. A translucent preview disc shows where your piece will land before you commit.
How does the computer opponent work?
The computer uses the minimax algorithm with alpha-beta pruning, the same family of techniques used in classic chess engines. It simulates future moves for both sides, scores the resulting positions using centre control and open lines of four, and picks the move that leads to the best guaranteed outcome. Higher difficulties search more moves ahead.
What is the difference between the difficulty levels?
Easy searches two moves ahead, so it blocks obvious wins but misses longer plans. Medium searches four moves ahead and punishes most careless play. Hard searches six moves ahead, sets up double threats, and rarely misses a forced win, so you will need real strategy to beat it.
What is the best first move in Connect Four?
The centre column, without question. Mathematical analysis proved in 1988 that the first player can force a win by opening in the centre. Starting in the columns next to the centre only draws with perfect play, and opening in the two outermost columns on either side actually loses against a perfect opponent.
Is Connect Four a solved game?
Yes. In 1988 James Dow Allen and Victor Allis independently solved it: with perfect play from both sides, the first player always wins by starting in the middle column. The full game tree contains 4,531,985,219,092 legal positions, so humans cannot memorise it, but computers can play it flawlessly.
Can two people play on the same device?
Yes. Switch the mode selector to two player and the board becomes a local hotseat game: player one and player two simply take turns on the same screen, with the status bar showing whose move it is. No second device or internet connection is required.
Are my scores saved?
The running tally of wins for each side, plus draws, is stored in your browser's local storage. It persists between visits on the same device and browser, and you can wipe it at any time with the reset scores button. Nothing is sent to a server.
Can a Connect Four game end in a draw?
Yes. If all 42 cells fill up and neither player has managed to connect four discs, the round is declared a draw and counted in the tally. Draws are rare in casual play because most games end long before the board fills, but they become more common between strong, defensive players.
Does this game work on phones and tablets?
Yes. The board is fully responsive and works with touch input: just tap a column to drop your disc. The layout scales to fit small screens, and because everything runs client-side there is no lag from a server round trip.
What strategy tips help a beginner improve fastest?
Three habits make the biggest difference: always consider the centre column first, always scan for any three-in-a-row (yours or the opponent's) before moving, and avoid placing a disc that gives the opponent a winning landing spot directly on top of it. Once those are automatic, start looking for moves that create two threats at once.

About Connect Four, Play Against the Computer

The rules take seconds to learn. Two players take turns dropping coloured discs into one of the seven columns; each disc slides down to the lowest empty cell. The first player to line up four of their own discs horizontally, vertically or diagonally wins the round. If all 42 cells fill up without a line of four, the game is a draw. In this browser version you can play against the computer, which uses a minimax search with alpha-beta pruning, or against a friend on the same device in local two player mode. A hover preview shows exactly where your disc will land, the winning four discs light up when a game ends, and the score tally is kept between rounds.

Good Connect Four play revolves around the centre column. A disc in the middle column can participate in more potential lines of four than a disc anywhere else, so claiming the centre early is almost always right. From there, the key skill is building double threats: two possible winning lines that the opponent cannot block at the same time. Equally important is defence, whenever your opponent has three discs in a row with a playable gap, you must respond immediately. Advanced players also track odd and even threats, because whether a winning cell sits on an odd or even row often decides who can force the win in a filled-up endgame.

Connect Four holds a special place in game theory because it is a solved game. In 1988, James Dow Allen and Victor Allis independently proved that the first player wins with perfect play by starting in the centre column, while opening in the outer columns actually loses against a perfect opponent. Of course, nobody plays perfectly, which is why the game stays fun. This version runs entirely in your browser, needs no account or installation, and saves your win tally locally on your device. Pick a difficulty, choose who starts, and see if you can outsmart the minimax engine.

Connect Four: The Solved Game with a Disputed Past

Toy inventor Howard Wexler, who had already licensed dozens of games, came up with Connect Four while thinking about how to make tic-tac-toe style play more interesting, and the answer was gravity. By forcing every piece to fall to the bottom of its column, the vertical frame removed the free placement of paper games and created a whole new layer of tactics. Milton Bradley launched it in 1974 and it became a massive hit. A persistent legend claims the game is centuries old and that Captain James Cook played a version so obsessively in his cabin that his crew called it the Captain's Mistress; the story is almost certainly apocryphal, but it stuck to the game and is still repeated on countless boxes and websites.

Connect Four earned a permanent place in computer science history in 1988, when it became one of the first non-trivial games to be solved twice in the same month. James Dow Allen announced a solution on October 1, 1988, and Victor Allis, then a master's student in the Netherlands, published his own independent proof just over two weeks later. Both reached the same conclusion: the first player wins with perfect play, but only by opening in the centre column. Allis's approach was especially elegant, combining nine strategic rules with a knowledge-based search, and his thesis remains a classic text for game AI students. Later brute-force work counted exactly 4,531,985,219,092 legal board positions.

The game's simple geometry has made it a favourite testbed ever since: countless university courses use it to teach minimax, alpha-beta pruning and machine learning, and in 2017 researchers even trained AlphaZero-style agents on it as a warm-up for harder games. Away from the labs, Connect Four keeps showing up in popular culture, from giant garden versions at fairs to speedrun-style competitive circuits where strong players exploit odd and even threat theory, a body of endgame knowledge deep enough that world-class matches are decided by which player controls a single square dozens of moves before the board fills.

Support