Strategy

How to never lose at Tic Tac Toe

Tic Tac Toe is a draw with perfect play, so a player who never makes a mistake can never lose. Here is exactly what "never making a mistake" looks like.

Tic Tac Toe is small enough that mathematicians and computers have checked every possible game. The result: if neither side makes a mistake, the game is always a draw. That has a useful consequence for you. You don't need to out-think your opponent to stay unbeaten, you only need to follow a short set of rules, every move, without skipping any.

The priority list

In 1972, the computer scientists Allen Newell and Herbert Simon described a simple ranked list of rules for playing Tic Tac Toe perfectly. On each turn, go down the list and play the first rule that applies:

  1. Win. If you have two in a line and the third square is free, take it.
  2. Block. If your opponent has two in a line, take the third square.
  3. Fork. Make a move that gives you two separate winning threats.
  4. Block a fork. If your opponent could fork next turn, stop it. Usually the best way is to make a two-in-a-row threat of your own that forces them to block somewhere harmless.
  5. Centre. Take the centre if it is free.
  6. Opposite corner. If your opponent is in a corner, take the corner diagonally opposite.
  7. Empty corner. Take any free corner.
  8. Empty edge. Take any free edge square.

Rules 1 and 2 are easy. Almost every lost game comes from skipping rule 4, so the rest of this guide focuses on it.

Replying to the first move

When you play second, your very first move decides whether you can still draw. There are only three kinds of opening, and each has a clear answer.

They open in the centre: take a corner

X takes the centre
Correct: any corner
Wrong: an edge loses

Against a centre opening, all four corners are safe and all four edges lose by force. After an edge reply, X can build a fork you can't stop.

They open in a corner: take the centre

X takes a corner
Correct: the centre

This is the strictest case. Of your eight possible replies, only the centre draws. Every other square, including the opposite corner, loses against good play.

They open on an edge: centre, a neighbouring corner, or the opposite edge

The edge opening is the most forgiving. The centre, either corner next to X's mark, and the edge directly opposite all hold the draw. The two far corners and the two neighbouring edges lose.

The two traps every second player must know

Corner, centre, opposite corner

O to move: play an edge

X opens in a corner, you take the centre, X takes the opposite corner. Rule 7 says "take a corner", but here rule 4 overrides it: if you take a corner, X takes the remaining corner and forks. Play an edge instead. Your edge mark makes a line through the centre, X has to block it, and the danger is gone.

Centre, corner, opposite corner

O to move: play a corner

The mirror image of the first trap. X opens in the centre, you take a corner, X takes the corner opposite yours. Now the answer is the reverse: you must take one of the two remaining corners. Any edge loses.

Memory trick: if X holds two opposite corners, you play an edge. If X holds the centre and the corner opposite yours, you play a corner.

Playing first: you can't lose either

Going first is the more comfortable seat. Open in a corner or the centre and keep following the list, and no sequence of replies can beat you. Opening on an edge is also a draw with perfect play, but it gives your opponent more safe options and fewer chances to go wrong.

There is one trap for the first player too. If you open on an edge and your opponent takes the centre, do not take the edge directly opposite your first mark. That move hands the second player a winning attack.

How to practise

Knowing the list and applying it under time pressure are different things. The fastest way to make it automatic is to play against a perfect opponent until you stop losing. In the TicTacToe app, the Hard level uses a full game-tree search and never loses. If you can draw it game after game, playing first and second, your defence is perfect.

Once you can't lose, the next step is to start winning against people. How to win at Tic Tac Toe covers the attacking side, and why Tic Tac Toe is always a draw explains the maths behind this guide.