HomeGuides › Tic-Tac-Toe
Game Guide

Tic-Tac-Toe Is Solved. Here's How to Never Lose.

With perfect play from both sides, every game of Tic-Tac-Toe is a draw. That sounds like it makes the game pointless — it actually makes it a clean lesson in forcing moves and double threats.

Tic-Tac-Toe has been played in some form for a very long time; grid games with a similar shape turn up in the ancient world, and the three-in-a-row version we know is a direct descendant. Its modern significance is different: it's small enough to be completely solved, which makes it one of the best teaching examples in game theory.

Solved means the entire game tree has been worked out. Every possible position has a known best move and a known outcome. The conclusion is unambiguous: if both players play perfectly, the game is always a draw. You cannot force a win against a perfect opponent — but you can guarantee you never lose.

The three principles, in priority order

Almost all of correct play collapses into a simple checklist. On every turn, run through it in order and take the first thing that applies.

  1. Can I win this move? If two of your marks share a line and the third square is empty, take it. Nothing else matters.
  2. Can my opponent win next move? If they have two in a line with an empty third, block it.
  3. Can I create two threats at once? This is where games are actually won.

Steps 1 and 2 are obvious enough that most players do them automatically. Step 3 is where beginners lose.

The double threat (the fork)

A fork is a single move that creates two separate winning threats at the same time. Your opponent can block one of them. They cannot block both. The game is decided the moment the fork lands — everything after is formality.

Every loss in Tic-Tac-Toe between competent players comes from allowing a fork. Every win comes from creating one.

Playing first: the centre opening

The centre square sits on four of the eight winning lines — both diagonals, the middle row, and the middle column. No other square touches more than three. Opening in the centre is the strongest first move because it maximises the lines available to you and denies your opponent the most valuable square on the board.

If your opponent responds anywhere other than a corner, they've made a mistake and you can usually build a fork within two moves. If they respond in a corner — the correct reply — the game heads toward a draw with accurate play from both sides.

Corner openings and the trap

A corner opening is also strong, and against a human opponent it's arguably more practically dangerous than the centre, because the correct defence is less intuitive. After a corner opening, the only reply that holds the draw is the centre. Anything else — another corner, an edge — hands you a forced win with correct follow-up.

Never open on an edge. Edge squares sit on only two winning lines each, making them the weakest opening on the board. There is no situation where an edge is your best first move.

Playing second: how to survive

Going second is harder, and the defence depends entirely on their opening:

After that, work the checklist: win if you can, block if you must, and check every move you're considering for whether it hands them a fork.

The number that makes it solvable

There are 255,168 possible complete games of Tic-Tac-Toe if you count every sequence of moves. Accounting for symmetry — rotations and reflections that are strategically identical — the number of genuinely distinct positions drops to a few hundred. That's small enough that the whole game can be worked out exhaustively, which is why it shows up in almost every introductory course on game trees and minimax search.

It's also why writing a Tic-Tac-Toe opponent that never loses is a standard beginner programming exercise, while the same approach is hopeless for chess or Go.

Tic-Tac-Toe is in the Games tab. Try opening in a corner rather than the centre and see whether your opponent finds the only correct reply.

Play Tic-Tac-Toe →

What to do with a solved game

Once both players know the strategy, every game is a draw and the fun runs out — which is exactly what happens to most people around age eight. The interesting move at that point is to change the rules rather than the players: larger boards, four-in-a-row, gravity-fed columns, or three-dimensional grids. All of these grow the game tree past the point of easy solution, which is where the strategy gets interesting again.