Connect 4 online

Play Connect 4 online against the computer, from easy to a perfect solver, or against a friend on the same screen or by link. Stuck? The Best move button asks the solver.

Tap a column, or press 1 to 7. Arrows and Enter also work.

Your results against the computer

How to play Connect 4 online

This Connect 4 online game uses the standard board: 7 columns and 6 rows, standing upright. Players take turns dropping a disc into a column, and the disc falls to the lowest free space. The first player to line up four discs of their color wins, across, up and down, or on either diagonal. If all 42 spaces fill up with no four in a row, the game is a draw. Red always moves first.

Tap or click a column to drop your disc. With a keyboard, press 1 to 7, or move with the arrow keys and press Enter. Choose You start to play red, or Computer starts to play yellow. Undo takes back your last move (and the computer's reply), and New game starts over. Your game is saved in this browser, so it survives a reload.

The four computer levels

  • Easy wins if it can win at once and blocks your immediate win; otherwise it drops its disc in a random column. A good level to learn the rules.
  • Medium looks three discs ahead and scores the board by its open lines of two and three. It sees simple traps but falls for deeper ones.
  • Hard looks up to ten discs ahead with the same scoring, within about a second and a half. It is hard to beat without a plan.
  • Perfect uses the solver from our Connect 4 solver plus an opening book: about 45,000 early positions whose result we proved in advance with that same solver. For each column it works out whether that move wins, draws or loses against perfect play and picks the best; among equally good columns it takes the quickest win or the longest defense when it can work that out in time. When it moves first it opens in the center column and cannot be beaten. It thinks for 8 seconds at most; if a move is not proven by then (rare, and only in unusual openings), it plays the best result it has proven and the page says so.

We tested the levels against each other, 30 to 40 games per pair with the first move alternating. The perfect level won all 120 of its games against random moves, easy, medium and hard, and never let a proven win or draw slip. Hard beat medium 38 times in 40 (one loss, one draw), and medium beat easy 40 times in 40. Our solver also checked the empty board: only the center column wins for the first player, columns 3 and 5 lead to a draw and the other four lose, as published in 1988.

Two players on one screen

Choose Two players to play a friend on the same phone or computer. The board, undo and the best-move hint all work the same way; the computer does not play.

Play a friend by link

Choose Friend by link to play someone who is not next to you. Pick You start or Your friend starts, drop your disc, then send the link under the board with Share (on a phone) or Copy link. Your friend opens it, sees the same board, drops a disc and sends the new link back. It works like correspondence chess: you can take minutes or days between moves.

The whole game travels in the link, after the # sign, so nothing is sent to a server, nobody needs an account, and the link works on any phone or computer. Each browser remembers which color it plays, so the board only accepts a move when it is your turn; opening an older link of the same game keeps the newer position. Undo and the solver are off in this mode, so the game stays fair.

Best move and scores

Best move runs the perfect level's search for you and marks the best column, with what it leads to: a win, a draw, or a loss against perfect play, and how soon when that is worked out in time. Tick Show scores to see a score above every column. 0 means a draw with perfect play, a positive score means the player to move wins with that column, a negative one means they lose, and bigger is always better. The scores fill in as each column is proven: win, draw or loss first (+?, -?), the exact number later. With few discs on the board the exact numbers can take minutes. If Best move has not proven its answer within 8 seconds, it says so.

Strategy tips

Start in the center: the middle column is part of more possible fours than any other. With perfect play from both sides the first player wins, but only by starting in the center column. That was proven in 1988 by James Dow Allen and, independently, by Victor Allis. Build threats that need two moves to stop, and watch the spaces directly above your opponent's threats: a disc there can hand them the win. A classic rule from Allis's analysis is that the first player wants threats on odd rows (1, 3 and 5, counted from the bottom) and the second player on even rows, because those are the spaces each side tends to get when the board fills up. Use the Best move button after a game to see where it turned.

Solver tested . Found a problem? Tell us.

Questions

Can you always win Connect 4 if you go first?

Yes, in theory. With perfect play from both sides, the first player wins by dropping the first disc in the center column. Starting in any other column lets the second player draw or win. In practice nobody remembers enough of the perfect lines, which is why the game stays fun.

Is the perfect level unbeatable?

Yes, when it moves first: it opens in the center, which wins with perfect play, and it follows proven winning moves from there. When you move first you can win only with perfect play from the center. It never turns a proven win or draw into a loss. In rare, unusual openings it may run out of its 8 seconds before proving a move; then it plays the best result it has proven and tells you.

What do the column scores mean?

0 means the game ends in a draw if both sides play perfectly. A positive score means the player to move wins with that column, a negative score means they lose. The size says how fast: the score is 22 minus the number of discs the winner has used when the four is completed, so +18 is the fastest win.

Can I play Connect 4 against a friend here?

Yes. Choose Two players and take turns on the same screen. The best-move hint works in that mode too, so you can settle arguments after the game.

Is this the official Connect 4 game?

No. Connect 4 is a trademark of Hasbro and this site is not affiliated with Hasbro. We use the name only to describe the game, which follows the standard rules: 7 columns, 6 rows, four in a row wins.