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):
- Center — belongs to 4 winning lines. The strongest square.
- Corner — belongs to 3 winning lines. The second-strongest.
- Edge — belongs to 2 winning lines. The weakest.
Opening theory for player X
- 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.
- 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.
- 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:
- Win. If you have two in a row, play the third.
- Block. If the opponent has two in a row, block the third.
- Fork. Create a position with two simultaneous winning threats. The opponent can only block one, so you win next turn.
- 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.
- Center. Take the center if available.
- Opposite corner. If the opponent holds a corner, take the diagonally opposite corner.
- Empty corner. Take any empty corner.
- 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
- If X opens in the center, always respond with a corner. Any edge response loses.
- If X opens in a corner, always respond with the center. Any other response loses with correct follow-up.
- If X opens on an edge, respond with the center, an adjacent corner, or the opposite edge. These all hold the draw.
By the numbers
- Total possible games: 255,168
- Games ending in an X win: 131,184 (first-player advantage)
- Games ending in an O win: 77,904
- Games ending in a draw: 46,080
- Unique board positions (accounting for symmetry): 765
- Unique terminal positions: 138
Frequently asked questions
What is the best first move in tic-tac-toe?
Can you always win at tic-tac-toe?
What is a fork in tic-tac-toe?
How many possible tic-tac-toe games are there?
Related: Rules · Glossary · Variants
Last updated