The Unbeatable Tic-Tac-Toe Strategy (Never Lose Again)

A complete tic-tac-toe strategy that never loses: the best opening, how to block forks, and how to force a fork yourself. Plus how the perfect computer plays.

Updated 5 min read By CodingEagles
Free tool Tic-Tac-Toe Play a friend, or an AI that never loses. Open tool

Tic-tac-toe is a solved game, which means there is a strategy that never loses. Play it correctly and the worst result you can get is a draw. Beat a careless opponent and you win. Here is the move order that guarantees it, and the trap that turns an opponent’s mistake into a win. Test it against the perfect computer on the tic-tac-toe board.

Take the centre

If you move first, take the centre. It belongs to four of the eight winning lines, more than any other square, so it gives you the most ways to build a threat and the best position to block one. If the centre is taken when it is your turn, grab a corner instead. Corners sit on three lines each; edges sit on only two and are the weakest squares.

The order of priorities each turn

On every move, run down this list and take the first one that applies:

  1. Win. If you have two in a line with the third square open, complete it.
  2. Block. If your opponent has two in a line, block the open square.
  3. Make a fork. Play a move that creates two separate two-in-a-rows at once, so your opponent can only block one.
  4. Block a fork. If your opponent could make a fork next move, prevent it, ideally by creating a threat of your own that forces their reply.
  5. Take the centre, then a corner, then an edge.

Follow this order without exception and you cannot lose. Most losses come from skipping step 2 to chase your own line.

Forks: how the wins actually happen

A fork is two threats in one move. Your opponent blocks one, you complete the other. Against a player who does not see it coming, this is how you win.

The classic setup as the first player: take a corner, and if the opponent replies anywhere but the centre, take the opposite corner. You now threaten to build lines through both corners, and a third corner move often leaves two winning lines open at once.

Defending against a fork

The danger is letting your opponent build a fork against you. The defence is not always to block a square directly. Instead, make your own two-in-a-row so they are forced to block it, which uses up the move they needed to set their trap. Steering their reply like this is the heart of perfect defence, and it is what keeps a sharp game a draw.

Why the computer is unbeatable

The tic-tac-toe board offers a computer that never loses. It works by looking ahead through every possible continuation of the game and scoring each ending as a win, loss or draw, then choosing a move that can never lead to a loss. Because the whole game tree is small, it can search it completely, so its play is genuinely perfect. The best you can do against it is force the draw, which is exactly the skill this strategy teaches.

For why short logic games like this are worth playing, see the benefits of puzzle games, or open the tic-tac-toe board and try to hold the computer to a draw.

Frequently asked questions

Can you always win at tic-tac-toe?
No, not against someone who plays correctly. With perfect play from both sides, tic-tac-toe is always a draw. You can guarantee never to lose, and you can win against a player who makes a mistake, but you cannot force a win against flawless defence.
What is the best first move in tic-tac-toe?
The centre is the strongest opening because it sits on four of the eight winning lines, more than any other square. A corner is the next best and sets up the most ways to create a double threat. The edges are the weakest first move.
How does the computer never lose at tic-tac-toe?
It looks at every possible continuation of the game and scores each one as a win, draw or loss, then picks a move that cannot lead to a loss. Because the game is small enough to search completely, this perfect-play approach guarantees at least a draw every time.

Ready to try it?

Play a friend, or an AI that never loses. Free, in-browser, and 100% private — your data never leaves your device.

Open the Tic-Tac-Toe