Skip to content
JustTools

Connect Four

Drop your discs and line up four in a row — across, down or diagonally — against a computer that ranges from easy to tough, or with a friend on the same screen.

Runs in your browser Free · no sign-up

At a glance

  • The classic 7-column, 6-row board, plus larger 8×7 and 9×7 boards for a longer game.
  • Play the computer on Easy, Medium or Hard, or a friend taking turns on the same phone, tablet or computer.
  • Hard searches many moves ahead — with alpha-beta pruning and a transposition table — for up to a second per move and never misses a win or a block it can see.
  • Connect Four is a solved game: with perfect play the first player wins by starting in the centre column, at the latest on the 41st move. James D. Allen and Victor Allis proved it independently in October 1988.
  • The 7×6 board has 4,531,985,219,092 possible positions.
  • Hints, undo, sound, full screen and keyboard play (keys 1–7 drop a disc); scores are kept on your device. Free, with no download or sign-up.

Step by step

How to play Connect Four

  1. 1

    Pick an opponent

    Choose Computer and a difficulty, and your colour — Red moves first — or A friend to play on the same device.

  2. 2

    Drop a disc

    Tap a column (or press its number). The disc falls to the lowest free space.

  3. 3

    Make four in a row

    Line up four of your discs across, down or diagonally before your opponent does. A full board with no line is a draw.

  4. 4

    Play again

    Press Play again — the score keeps adding up. Use Hint or Undo while you learn.

Features

Everything you need, nothing you don’t

An opponent for everyone

Easy for children, Medium for a fair game and Hard for a real challenge — it blocks threats and sets up its own.

Two players, one screen

Pass the phone or share the keyboard, with your own names and a running score.

Learn the tricks

Ask for a hint to see the strongest column — it tells you when a forced win is on the board.

Fair starts

Turn on “Take turns going first” so the first move swaps every game — going first is a real advantage.

Bigger boards

Try 8×7 or 9×7 for more room to build threats.

Plays anywhere

Phones, tablets and computers, with keyboard control and screen-reader announcements of every move.

Connect Four strategy

  • Take the centre. The middle column is part of more possible lines than any other — that is why perfect play starts there.
  • Block threes at once. If your opponent has three in a row with an empty square they can reach, drop there before anything else.
  • Build double threats. Two winning squares at the same time can’t both be blocked — the most common way games are won.
  • Watch the square below. Don’t fill the space directly under your opponent’s winning square: your disc lets theirs land on it.
  • Think in rows. The first player usually wants threats on odd rows (counting from the bottom), the second player on even rows — a key idea in Victor Allis’s solution.

How the computer plays

The computer reads the board column by column, tries the centre first and looks ahead with a minimax search pruned by alpha-beta, remembering positions it has already scored. When it can’t see to the end of the game it scores the board by the open lines each side still has. Hard thinks for up to a second and often looks ten or more moves ahead; it is strong, but it is not a perfect solver — a well-built trap can still beat it.

FAQ

Frequently asked questions

Who wins Connect Four with perfect play?

The first player. Starting in the middle column, the first player can always force a win — at the latest on the 41st move. James D. Allen and Victor Allis showed this independently in 1988.

How many positions are there in Connect Four?

On the standard 7×6 board there are 4,531,985,219,092 legal positions.

Can I play against a friend?

Yes — choose A friend and take turns on the same device. You can type your names, and the score is kept for each board size.

Is the Hard level unbeatable?

No, but it is tough: it never misses a win or a block it can see and looks many moves ahead. Set up two threats at once, or a threat it can’t reach in time, to beat it.

Can I take back a move?

Yes. Undo takes back your last move (and the computer’s reply). Use Hint to see the column the computer would pick for you.

Does it work offline?

Once the page has loaded, yes — the game and the computer run entirely in your browser, and nothing is sent anywhere.

Keep going

Browse every tool

Last updated Report a problem or suggest a feature