Tic-Tac-Toe Strategy

Zero Sum Game

If you know what you are doing, you can’t lose at Tic-Tac-Toe. If your opponent knows what they are doing, you can’t win at Tic-Tac-Toe. The game is a zero sum game. If both players are playing with an optimal strategy, every game will end in a tie.

Surpisingly few people know optimal Tic-Tac-Toe stategy. Yes there are some people (and computers) that you will never beat, but they are relatively rare. Knowing this, you can become a Tic-Tac-Toe master.

Before getting started, open a Tic-Tac-Toe playing board in a new browser window so that you can experiment while you read this article.


There are four player types in Tic-Tac-Toe.

  • The Novice player makes random moves
  • The Intermediate player will blocks their opponent from winning
  • The Experienced player knows that playing in certain first squares will lose the game
  • The Expert player will never lose

Pitting these players against each other, you can see that in all cases, the better player wins more.

Experimental win statistics after 1000 games for each matching
Player Two
Novice Intermediate Experienced Expert
Player One Novice 1 wins: 57.1%
2 wins: 30.6%
Ties: 12.3%
1 wins: 6.40%
2 wins: 68.3%
Ties: 25.3%
1 wins: 2.60%
2 wins: 76.4%
Ties: 21.0%
1 wins: 0.00%
2 wins: 79.6%
Ties: 20.4%
Intermediate 1 wins: 90.4%
2 wins: 1.60%
Ties: 8.00%
1 wins: 31.6%
2 wins: 17.1%
Ties: 51.3%
1 wins: 16.1%
2 wins: 10.3%
Ties: 73.6%
1 wins: 0.00%
2 wins: 16.1%
Ties: 83.9%
Experienced 1 wins: 90.8%
2 wins: .700%
Ties: 8.50%
1 wins: 35.5%
2 wins: 11.7%
Ties: 52.8%
1 wins: 13.3%
2 wins: .800%
Ties: 85.9%
1 wins: 0.00%
2 wins: 1.70%
Ties: 98.3%
Expert 1 wins: 97.8%
2 wins: 0.00%
Ties: 2.20%
1 wins: 76.6%
2 wins: 0.00%
Ties: 23.4%
1 wins: 27.1%
2 wins: 0.00%
Ties: 72.9%
1 wins: 0.00%
2 wins: 0.00%
Ties: 100.%

Expert – The player that can’t lose

On the Tic-Tac-Toe game board that you have opened in a new window, choose the “Expert” type for each player and hit “New Game”. Verify that the result of each game is a tie (cat’s game).

Cat’s Game

Neither of the computer players can be beaten because they are playing as well as game can be played. The computer does this by playing out every single game of Tic-Tac-Toe ahead of time and figuring out which moves are good and which are bad. The computer can do this because there are not a lot of possible games. The first move can be played in any of nine squares, the second in any of eight squares, the third in any of seven squares and so on. That means there are at most nine factorial or 362,880 possible games. A computer can breeze though 400,000 games in a blink of an eye. In reality, it has to play far fewer games than that. There are only 125,168 games of Tic-Tac-Toe because somebody wins most of them before all off the squares have been filled. The Tic-Tac-Toe is symetrical and if the computer can realize that many games are the same because it could rotate the board, there are even fewer games than that. Suffice to say that computers win through brute force.

So how can a human become unbeatable in Tic-Tac-Toe? A human doesn’t even have time to play out one hundred games in the mind and still make a move in a reasonable amount of time. However, a human can compensate with experience and reasoning.


A player that moves randomly will not see that an opponent should be blocked.
O   X
O X  

Novice – Stupid random play

Everybody can beat the “Novice” player virtually every game. Set one player to Novice and the other to human and observe how easy it is to beat the novice.

The novice simply places its mark in any empty square. This stategy is very poor and almost never wins.


A reactionary player will block an opponent’s win.
O   X
Typical statistics after two intermediate players play many games.
Player First Type Wins Record
X 200 31.5%
O 116 18.3%
Cat 319 50.2%

Intermediate – reactionary play

Most Tic-Tac-Toe players start off as reactionary players. Reactionary players will block their opponents three in a row, or take any three in a row that they can. Otherwise, they play like a novice and choose random moves. This style of play is what the “Intermediate” computer player uses.

Experienced – knows how to start

The experienced player knows the best starting moves. The stategies below explain these moves in detail.


Move First

If two intermediate players play many games. The player that goes first will win about twice as often as the player that goes second. Verify this for yourself by pitting two intermediate players against each other and watching the stats as you have them play many new games.

On some level this makes sense. There are only nine squares on a Tic-Tac-Toe board, the first player will get five of them but the second player will only get four.

When two experts play, the game always ends in a tie. In all other cases, the player that goes first wins far more than they would have if their opponent had gone first.

Know the bad first moves


Safe moves for player 1’s first move

Player 1

If you are going first, know the safe first moves. The trick is to avoid the edges. The corners and the center are safe moves:

Player 2

There are two possibilities. Either player 1 took the corner, or the center.


Safe moves for player 2’s first move (player 1 in center)


Safe moves for player 2’s first move (player 1 in corner)


Best moves for player 1’s first move

Player 1 can be ruthless

If player 1 moves in the corner for the first move, player 2 must take the center. If player 1 is playing against a novice, player 1 can be ruthless and always play in the corner first. That leaves a lot of board for novice to choose from and player 1 will win more often.

Become an expert

The first moves (or opening book) are the hardest to figure out. Beyond the first move, it doesn’t take much practice to move from being an experienced player to being an expert player. One good way to go about it is to play the fool against a computer expert player and see how you get beaten. Try known bad first moves and see how the compuer can outwit you every time. Beyond this point, I leave becoming an expert as an exercise to the reader.

Leave a comment

Your email address will not be published. Required fields are marked *

6 thoughts on “Tic-Tac-Toe Strategy

  • Anonymous

    I did Expert vs Expert, and sure enough, nobody won. However, strangely, I found that a Novice can beat an Expert about 3% of the time when the Novice goes first, and about 1% of the time when the expert goes first. Why is it that a novice can beat an expert but an expert can lose against a novice?

    Results were simulated with 10,000 games using an autoclicker.

    • Anonymous

      If the expert computer moves are instant it must be programmed for each starting move, including all four edges or an edge first move might cause it to not know where to go at one of it’s moves and give the player a free turn then it is possible to beat. Also I’ve yet to discover a scenario where the first move can lose if played correctly regardless of which square is picked first.

      Also to explain why expert vs expert is always a tie, that is easier to program for because the moves are more limited.

  • :o)

    I agree with anonymous’s confusion about the percentage rate of when either The Expert or the Novice goes first, which was within his/her most recent Comment s/he posted on June 3rd. I love Tic-Tac-Toe, but no one ever plays with me. Therefore, I can say that I am Intermediate. I have played with novice people and have seen novice against novice AND novice against expert. The same excact thing happened, and I was baffled when the Novice – Novice (N-N) team barely got any scores, while Team Novice – Expert (N-E) had the N go first (the E was being generous) and the Novice won many more times. It WAS then harder for the E to win (and he got mad about it)! I just wanted to agree with Anonymous because his/her comment really related to my thoughts, and I think other people don’t look strongly to other really important and reinforced thoughts and ideas. :o)

    (I also didn’t notice I’m making this comment in 2017 while s/he wrote it in 2015)!!!

  • Robb

    I’m confused why the claim is made that there are 9! games possible. I believe the number should be 3^9 (19683).

    To take my point consider that each square of the board can either be blank ‘B’, have an ‘X’, or an ‘O’. So a single square can only have 3^1 possible contents. If the board consisted of two squares, then the possible combinations would be BB, BX, BO, XB, XX, XO, OB, OX, OO. That is 9, or 3^2. So for 9 squares the number of possible combinations would be 3^9.

    I’d agree that optimized strategy makes for a game that can never be won. I’ve written a program in FreeBasic to try out the matchbox method of machine learning demonstrated in Matt Parker’s video (https://www.youtube.com/watch?v=R9c-_neaxeU) that shows that after a few thousand rounds the computer learns to tie every game.

    • Stephen Post author

      It is 9! because the first move has 9 choices of square, then the second 8 choices, the third 7, and so on. There are 3^9 game states, but there are more games than that because multiple games can arrive at the same state. That doesn’t take into effect the order in which moves are played. For example consider that there is XOX in the first row. It could be that X’s first move was in either corner. Game state alone does not tell you that. The order in which moves are made is vitally important in Tic-Tac-Toe. Making moves in the wrong order will lose games.

  • Anonymous

    I feel like the intermediate and the experienced groups are the closest in skill level. I ran the test were the intermediate plays first against the experienced. I ran 147 tests. It was a tie in 124 (84.4%) of the tests. the intermediate won 11(7.5%). While the experienced won 12 (8.2%).