Play Four in a Row Online

Drop your discs into one of the seven columns and be the first to line up four – horizontally, vertically or diagonally. Play the computer or a friend on the same device; your score is saved.

Four in a Row

0
Draws
0
0

Keyboard: left/right arrows choose a column, Enter or Space drops the disc; 1–7 drop directly (1 = left). After a game, Enter starts a new one.

Score and settings are stored only in this browser (localStorage).

Result

How it is calculated

How to play Four in a Row

The game is played on an upright board with 7 columns and 6 rows – 42 spaces in total. Two sides, here Blue and Orange, take turns choosing a column. The disc drops to the lowest free space in that column. The first side to get four of its own discs in a line wins: horizontally, vertically or diagonally. If the board fills up without a line of four, the game is a draw. The game is also known under other names; the rules are the same everywhere.

  1. Choose a mode: “Vs computer” (you play Blue) or “Two players” on one phone, tablet or computer.
  2. Who starts: you, the computer or alternate – with “Alternate” the other side starts each new round.
  3. Pick a column: tap or click anywhere in the column; on a keyboard use the arrow keys and Enter, or the digits 1–7.

The winning line is highlighted at the end. Orange discs also have a light centre so they can be told apart without relying on colour.

The three computer levels

Tips to win more

Is the game solved?

Yes. In 1988 James D. Allen and Victor Allis independently showed that with perfect play the first player wins – provided they start in the middle column. The Hard computer does not search to the end of the game, so it can be beaten.

Score and privacy

Wins, losses and draws are counted separately for “Vs computer” and “Two players” and stored with your settings in your browser’s localStorage (key vierinreihe). Nothing is sent to a server. The computer’s randomness comes from the browser’s cryptography API.

More games: Tic-tac-toe, Sudoku, Hangman or the dice roller.

Frequently asked questions

How many rows and columns does the board have?

The board has 7 columns and 6 rows, 42 spaces in total. Each side therefore has at most 21 discs; if the board fills up without a line of four, the game is a draw.

Can you win diagonally?

Yes. Four discs in a line win horizontally, vertically and on both diagonals. A square of four discs does not count.

How do you always win?

Against a perfect opponent only the side that moves first can force a win – and only by starting in the middle column; this was worked out in 1988. In practice: take the centre, build two threats at once and never play below your opponent’s winning space.

What is the best strategy when going second?

Block the centre early, answer every immediate threat and look for spaces where your opponent cannot play without giving you a winning space above it. The Hard level is a good sparring partner for this.

Can I play with 2 players?

Yes, on one device: choose “Two players” and Blue and Orange take turns on the same phone, tablet or computer. The score for this mode is counted separately.

Who goes first?

You decide: you (Blue), the computer or alternate. With “Alternate” the other side starts each new round; the first round starts with Blue.

How strong is the Hard computer?

It looks nine plies ahead and reliably finds traps and threats. It does not search to the end of the game, so a well-prepared double threat that only pays off late can beat it.

Sources and legal basis

As of:

Related tools