How to Win Tic Tac Toe Every Time (or Never Lose)
The complete Tic-Tac-Toe strategy: the best opening moves, how to answer each opening as second player, and how to set up winning forks.
Tic-tac-toe is one of the few games that has been completely worked out: if both players play perfectly, every game is a draw. That might sound like it takes the fun out of it, but it actually gives you a clear goal. Learn a handful of rules and you'll never lose. Learn a few traps and you'll win whenever your opponent slips.
In the diagrams, squares are numbered like a phone keypad:
Squares 1, 3, 7 and 9 are corners, 5 is the centre, and 2, 4, 6 and 8 are edges.
The priority list
On every turn, go through this list from the top and play the first thing that applies. This alone guarantees you'll never lose.
- Win: if you have two in a line with the third square empty, take it.
- Block: if your opponent has two in a line with the third empty, take that square.
- Fork: make a move that creates two separate winning threats at once.
- Block a fork: if your opponent could fork next turn, stop it, ideally by making a threat of your own that forces them to respond.
- Centre: take the centre if it's free.
- Opposite corner: if your opponent is in a corner, take the diagonally opposite one.
- Empty corner, then empty edge.
What is a fork?
A fork is the only way to beat a careful opponent. It's a single move that sets up two different lines needing just one more mark each. Your opponent can block only one of them, so you complete the other next turn.
Here's how this position arose. X opened in corner 1, and O made the classic mistake of answering on edge 2. X took the centre (5), threatening 1-5-9, so O was forced to block at 9. Now X plays corner 7 (green). That single move threatens 1-4-7 down the left side and 7-5-3 on the diagonal. O can block only one, and X wins next turn. Forks almost always come from combining corners with the centre.
Playing first (X)
Open in a corner
The centre and the corners are both safe openings. The corner is the better practical choice, because it gives your opponent the most chances to go wrong. Of the eight possible replies to a corner opening, only the centre avoids a forced loss.
- If they reply on an edge or a corner: you can force a win. A strong plan is to take another corner so that you threaten a line, forcing them to block, and then play a third corner that creates a fork.
- If they reply in the centre: take the opposite corner (for example 1 then 9). If they now play a corner, block and then fork; if they play an edge, which is correct, the game will be a draw with careful play.
Open in the centre
Against a centre opening, the second player must answer in a corner. If they answer on an edge, you can win by taking a corner that forces a block and leads into a fork.
Playing second (O)
As the second player, your job is mainly not to lose. Two rules cover almost everything:
- If X opens in a corner, take the centre. Then, if X takes the opposite corner, play an edge, not a corner. A corner here lets X fork.
- If X opens in the centre, take a corner. An edge reply loses.
- If X opens on an edge, the centre, an adjacent corner or the opposite edge are all safe.
The most common beginner mistake as O is answering a corner with an edge or another corner. Against a good opponent, that's already a lost game.
How the unbeatable computer thinks
Our hardest computer opponent uses an approach called minimax. For each possible move, it imagines every possible reply, then every reply to that, all the way to the end of the game. It scores finished games as +1 for a win, −1 for a loss and 0 for a draw, and assumes both sides always pick the best move for themselves. Tic-tac-toe is small, with only 255,168 possible complete games, so the computer can examine the whole game tree almost instantly and never makes a mistake.
It also prefers quicker wins and slower losses, so if it can win in two moves instead of four, it will.
Practice plan
- Play Medium and try to win using a fork. Medium blocks single threats but doesn't see forks coming.
- Switch to Unbeatable and aim for ten draws in a row. If you lose, look at which rule from the priority list you skipped.
- Then try the same tricks on a friend in two-player mode.
Once tic-tac-toe feels easy, the same ideas of threats and forks carry over directly to Four in a Row, a game that's far too big to memorise.