How to be Unbeatable at Tic-Tac-Toe

If you follow these steps, you will never lose at tic-tac-toe! You can tie or win every game.

Preface

Before beginning, keep in mind that some board cases are symmetric to others when the board is rotated or mirrored. For example, in a new game, consider the four possible corner moves player X could make:

X


X





X


X

Although these are four different moves, there is only one unique corner move. All four cases are identical because the board can be rotated by either 90°, -90°, or 180° to match any of the other corner moves.

In addition, the board can be mirrored across four possible axes: vertical "|", horizontal "-", forward diagonal "/" and backward diagonal "\". For example, these two states are identical when the board is mirrored across the vertical axis:


O
X
X
O

As another example, these two states are identical when the board is mirrored across the backward diagonal "\" axis:


O
X


OX

For Player X to be Unbeatable

Player X goes first. The best move is the corner. Below are the possible outcomes if player X makes the best move in every turn. The blue highlighted squares are the current move, and the green highlighted squares are where player X can go to win in the next turn. By creating two ways to win, player O can only block one of them and the other green highlighted square is still open, enabling player X to win!

X


Scroll →
XO



XO
X


XO
X
O

XO
XX
O

X Wins!
X O



X O
X


X O
X
O

X O
XX
O

X Wins!
X
O


X
XO


X
XO
O

X X
XO
O

X Wins!
X

O

X

X O

X
O
X O

X X
O
X O

X Wins!
X
O


X
O
X

X O
O
X

X O
O
X X

X Wins!
XO
O
X

XO
O
XX

XO
O
OXX

XOX
O
OXX

XOX
OO
OXX

XOX
XOO
OXX

Cat's Game!

For Player O to be Unbeatable

Player X goes first. There are three unique moves.

Scroll →
X



X
O

XX
O


XXO
O


XXO
O
X

XXO
OO
X

XXO
OOX
X

Cat's Game!
X X
O


XOX
O


XOX
O
X

XOX
O
OX

XOX
O
OXX

XOX
OO
OXX

XOX
XOO
OXX

Cat's Game!
X
OX


X
OX
O

X
XOX
O

X
XOX
O O

O Wins!
X
O
X

X
O
OX

XX
O
OX

XXO
O
OX

XXO
O
XOX

XXO
OO
XOX

XXO
OOX
XOX

Cat's Game!
X



X
O


Cat's Game!

X


O
X


Cat's Game!

Conclusion

If Player X's first move is a corner square, then player X is guaranteed to win unless player O moves in the center, followed by an edge square. This is counterintuitive because the edge squares are often worse, and yet it is player O's only chance in this situation! Unless player O is aware of this particular case, player X will win.

In contrast, it is very hard for player O to win. Although it is possible to win in the next turn, this requires player X to make a mistake by missing a place to block player O, which is hard to miss. The best way to win is by setting up a two-way victory that is one turn away. By the time player X must block an immediate win, there is a second way for player O to win that cannot be prevented! Unfortunately, there are very few cases that result in a two-way victory for player O, and none of them are very likely.

Now you can beat my computer player's hardest level 92% of the time!

Play Tic-Tac-Toe