Home › Guides › Tic Tac Toe Strategy

How to Never Lose at Tic Tac Toe

Updated November 2026 · 5 minute read

Tic Tac Toe is a "solved" game. That means mathematicians know exactly what perfect play looks like, and the result is always the same: if both players make no mistakes, the game ends in a draw. So you can learn to never lose, and you can learn to win whenever your opponent slips. This guide shows you how, whether you play X or O.

The basics, quickly

Two players take turns marking squares on a 3x3 grid. X always goes first. Whoever gets three marks in a row, horizontally, vertically or diagonally, wins. There are only about 255,000 possible games, which is why computers solved it so early. In fact, one of the very first video games, OXO, was a Tic Tac Toe program written in 1952 for the EDSAC computer at the University of Cambridge.

Three kinds of squares

Not all squares are equal. The center belongs to four possible lines, so it is the strongest square. Each corner belongs to three lines. Each edge (the middle square of a side) belongs to only two lines and is the weakest. Good play is mostly about taking the center and corners and making your opponent settle for edges.

Playing first as X

Playing second as O

The two rules that prevent every loss

Rule 1: win if you can. If you have two in a row with an empty third square, take it. Rule 2: block if you must. If your opponent has two in a row with an empty third square, take that square immediately. Before every move, check these two rules in this order. Almost every lost game comes from skipping one of them.

How to win: the fork

A fork is a move that creates two winning threats at once. Your opponent can block only one, so you win with the other. Here is a classic example. You are X, with marks in two opposite corners and your opponent in the center:

 X |   |
---+---+---
   | O |
---+---+---
   |   | X

Now it is O's move. If O takes one of the other corners, it looks natural, because it threatens a line through the center. But you simply block the third square of that line. That block gives you three corners and two open lines at once, so O can stop only one and you win. If O plays an edge instead, the game is a draw with correct play from both sides. The lesson: look for squares that sit on two of your open lines at the same time, and watch for the same squares in your opponent's lines, so you can take them first.

Beating the computer in this game

The computer on our Tic Tac Toe page wins when it can, blocks when it must and takes the center when it is free. After that it does not plan ahead. So play X, start in a corner, and when the computer takes the center, take the opposite corner. If the computer then picks a corner, you can win with the fork shown above. If it picks an edge, block its threat and settle for a draw. It does not always find the safe edge move, so this trap works a good share of the time.

Frequently asked questions

Is it possible to win every game?

No. Against a player who never makes a mistake, the best result for both sides is a draw. You can only win when your opponent errs.

Is it better to go first?

Yes, slightly. X has more ways to set a trap, but a careful O can always draw.

What is the worst opening move?

For O, answering a corner with an edge square loses against correct play. For X, starting on an edge gives your opponent the easiest game.

Ready to try it? Test these ideas against the computer or a friend.