Tic-Tac-Toe Strategy

With optimal play from both sides, tic-tac-toe always ends in a draw. The first player can force at most a draw; they can never force a win against perfect defense. The strategy below tells you how to never lose — as either player — and how to beat any opponent who makes a mistake.

The three squares, ranked

Every square on the 3x3 board belongs to some number of the eight winning lines (three rows, three columns, two diagonals):

Opening theory for player X

  1. Take the center on move 1. This forces O into a corner or edge response. If O plays an edge, X can force a win.
  2. If O responds to a center opening with an edge, X can force a win by moving to any corner that doesn’t lie on O’s line. O’s only safe response to a center opening is a corner — an edge response loses with correct play.
  3. Opening corners also force a draw at worst. Against an opponent who doesn’t take the center, a corner opening creates multiple fork opportunities. If O fails to take the center in response, X wins outright.

How to play perfectly — the priority list

Newell and Simon’s 1972 program and Martin Gardner’s writings give this ordered priority. On every turn, walk the list from top to bottom and play the first move that applies:

  1. Win. If you have two in a row, play the third.
  2. Block. If the opponent has two in a row, block the third.
  3. Fork. Create a position with two simultaneous winning threats. The opponent can only block one, so you win next turn.
  4. Block the opponent’s fork. If the opponent can create a fork, either (a) force them to block by creating your own two-in-a-row that isn’t at the fork square, or (b) occupy the fork square yourself.
  5. Center. Take the center if available.
  6. Opposite corner. If the opponent holds a corner, take the diagonally opposite corner.
  7. Empty corner. Take any empty corner.
  8. Empty edge. Take any empty edge.

Forks — the winning pattern

A fork is a position with two winning threats at once. The classic fork setup looks like this:

X . .      X . X      X . X
. X .  →   . X .  →   . X .
. . .      . . .      X . .

X holds the center and two non-adjacent corners. On X’s next move, X completes either the top row or the left column, and O cannot block both.

Defending as player O

By the numbers

Frequently asked questions

What is the best first move in tic-tac-toe?
The center is the best first move because it belongs to four of the eight possible winning lines — more than any other square. A corner is the second-best opening because it belongs to three winning lines. An edge is the weakest opening, belonging to only two.
Can you always win at tic-tac-toe?
No. With optimal play from both players, tic-tac-toe is a forced draw. The first player can force at most a draw; they can never guarantee a win against a defender who plays perfectly.
What is a fork in tic-tac-toe?
A fork is a position where a player has two simultaneous winning threats. Because the opponent can only block one threat per turn, a fork guarantees a win on the next move. Creating a fork is the central goal of offensive tic-tac-toe strategy.
How many possible tic-tac-toe games are there?
There are 255,168 possible games when played to completion, or 26,830 when the game ends as soon as a winner is determined. Accounting for board symmetries (rotations and reflections), there are 138 distinct terminal positions and 765 unique board states overall.

Related: Rules · Glossary · Variants

Last updated