Four in a Row (Connect Four)

Drop discs. Connect four. Classic.

Loading…
Your Room Code

How to Play Four in a Row

Players take turns dropping discs into one of seven columns. Discs fall to the lowest empty row. The first player to connect four discs in a row — horizontally, vertically, or diagonally — wins. If the grid fills up with no winner, the game is a draw.

Each turn you choose a column by clicking or tapping it. You cannot place a disc in a full column. A preview disc shows where your piece will land before you commit.

Four in a Row strategy

The center column is the most valuable position on the board. Discs placed in column 4 can contribute to four-in-a-rows in more directions than any edge column. Most strong players start there and work outward.

About the AI

The Easy AI plays random legal moves, so you can win by simply blocking its threats and playing toward the center. The Medium AI uses minimax search at depth 4 and plays reasonably well but still makes exploitable mistakes. The Hard AI searches to depth 8 with alpha-beta pruning and move ordering, making it very difficult to beat.

Alpha-beta pruning lets the Hard AI search the same depth in roughly a quarter of the time by cutting off branches that cannot affect the result. Even so, Connect Four has been solved: with perfect play from both sides, the first player always wins.

Can you always win at Four in a Row?

Yes, with perfect play. Connect Four was mathematically solved in 1988 by James Dow Allen and independently by Victor Allis. The first player can always force a win with optimal play. The winning strategy is complex enough that most players cannot execute it reliably, which is why the Hard AI still feels very challenging.

History of Connect Four

Connect Four was invented by Howard Wexler and Ned Strongin and first published by Milton Bradley in 1974. The game became one of the best-selling board games of the 1970s and remains popular today. The name "Four in a Row" is the more generic description used outside of the trademarked Connect Four brand.

Frequently asked questions

How do you win Four in a Row?

Be the first to get four of your discs in a row — horizontally, vertically, or diagonally. Each turn you drop a disc into a column and it falls to the lowest empty slot. If the board fills up completely with no four-in-a-row, the game is a draw.

What is the best first move in Connect Four?

The center column (column 4 of 7) is the strongest opening. It participates in more possible winning lines than any other column. Most strong players and all strong AIs start in the center.

Can I play against an AI?

Yes. Choose Easy, Medium, or Hard AI from the mode selector. Easy plays randomly. Medium looks four moves ahead. Hard searches to depth 8 with alpha-beta pruning and is very difficult to beat.

Can I play Four in a Row with a friend online?

Yes. Select Online mode to get a room code, then share the link or code with your friend. No account is required on either side. The room stays open while you are on the waiting screen.

Is Connect Four solved?

Yes. Connect Four was mathematically solved in 1988. With perfect play, the first player always wins. The Hard AI on this site approximates this with deep minimax search at depth 8.

Who invented Connect Four?

Connect Four was invented by Howard Wexler and Ned Strongin and first sold by Milton Bradley in 1974. It has been in continuous production ever since and is one of the best-selling board games of all time.

Games on TicToe.org
Tic Tac Toe
The classic. Play vs computer, locally, or with friends.
Terni Lapilli
The ancient Roman version. Pieces slide around the board.
✊
Rock Paper Scissors
Play vs the computer or challenge a friend online.
Ultimate Tic-Tac-Toe
9 boards in one. Beat the AI or play a friend online.
SameGame
Click groups of matching blocks to clear the board.
Battleship
Place your fleet and hunt down the enemy. Play vs computer or online.
🐍
Snake
The classic Nokia game. Eat and grow without hitting yourself.
Four in a Row
Drop discs, connect four. Beat the AI or play a friend online.
Achtung, die Kurve!
Curve fever. Up to 6 players online or vs bots.
Enjoying this game?