Connect Solver

Click a hole: empty → red → yellow.
Loading the solver…

Why?

Moves so far

Columns are numbered 1 to 7 from the left. Keys 1–7 drop a piece.

wins draws losesif both sides then play perfectly
X goes first.

Why?

Why perfect play is always a draw

  1. No first move can force a win. The app checked all 255,168 possible games: all nine first moves draw.
  2. Answer a corner with the middle. If X starts in a corner, O must take the middle. Every other reply loses.
  3. Forks win. A fork makes two lines of two at once. The other player can only block one of them.
  4. So nobody wins. If both players always block and never allow a fork, the board fills up with no three in a row.

Settings

Appearance

Mode

Updates

About

Connect Solver . Perfect play for Connect 4 and tic-tac-toe, explained in plain words. Works offline. MIT licence.

How it works

The Connect 4 solver looks at every possible game right to the end (negamax search with alpha-beta pruning, a memory of positions it has already solved, and an opening book of every position with up to 8 pieces, worked out ahead of time by the same solver). Tic-tac-toe is small enough to check every game. This app is not made by or connected with any toy or game company.

Help and shortcuts

Shift+1 / Shift+2Connect 4 / Tic-tac-toe tab
Connect 4: 1–7Drop a piece in that column
Tic-tac-toe: 1–9Mark a square (top row is 1 2 3)
U / N / B / FUndo / New game / Best move / Flip the Connect 4 view
Connect 4: drag a chipPick up the chip from the tray and drop it over a column
?This help

Reading the hints

Green means that move wins, blue means a draw, and red means a loss, if both players play perfectly from there. "Win in 5" counts every drop from now to the end, yours and the other player's.

Tutorial

Lessons

Six short lessons: why the middle is strong, threats, the "drop on top" trap, what "win in 7" means, and why tic-tac-toe is always a draw. Each one asks a quick question.

App tour

A tour of every part of the app, with live examples on screen. Your own games are put back afterwards.