Tic-Tac-Toe: Rules and Perfect-Play Strategy

Tic-tac-toe is simple enough for young children to learn in minutes, but it is also a fully "solved" game β€” meaning the outcome of perfect play is mathematically known in advance.

The setup: a 3x3 grid, two marks

Two players take turns marking empty squares on a 3x3 grid, one using X and the other O. X conventionally moves first.

Winning condition: three in a row

The first player to place three of their own marks in a row β€” horizontally, vertically, or diagonally β€” wins immediately. If all nine squares fill up with no such line, the game ends in a draw.

Strategy: take the center whenever it is open

The center square is part of more possible winning lines (four) than any edge or corner square, making it statistically the strongest opening move when the board is empty.

Strategy: prefer corners to edges

After the center, corner squares are part of three possible winning lines each, while edge squares are part of only two, so corners are generally the second-best move type when available.

Strategy: always block an opponent's two-in-a-row

Whenever the opponent has two marks in a line with the third square still open, blocking that square is mandatory on your next move β€” failing to block it hands the opponent an automatic win.

Strategy: watch for double-threat setups (forks)

A "fork" is a move that creates two different winning lines at once, which cannot both be blocked in a single move. Skilled players actively look to create forks for themselves and to prevent the opponent from setting one up.

A fully solved game, mathematically speaking

Because tic-tac-toe has a small enough number of possible board states, it has been completely mathematically analyzed: if both players always make the objectively best move, the result is always a draw, with neither X nor O able to force a win. This makes it a common first example in game theory and computer science courses for teaching the concept of a "solved" game.

Why first-move advantage exists but is not decisive

Going first (as X) does give a real edge against imperfect play, since X gets an extra move's worth of board control by the end of the game. However, that edge disappears entirely against a defender making correct blocking and forking decisions, which is why the standard version of the game is considered a fair, drawish contest between two attentive players rather than one favoring whoever moves first.

Frequently Asked Questions

Can you always avoid losing at tic-tac-toe?

Yes. If you always immediately block any two-in-a-row your opponent creates and avoid leaving a fork open for them, you can guarantee at least a draw regardless of what your opponent does β€” a loss only happens from a missed block or a missed fork.

Does moving first guarantee a win?

No. Against an opponent who plays correctly, going first only guarantees a draw at best, not a win β€” a genuine win only happens when the second player makes a mistake somewhere along the way.