You can't win tic-tac-toe against a player who never makes a mistake: with perfect play from both sides, every game is a draw. You win by giving your opponent chances to go wrong. As X, open in a corner and aim for a fork, a move that makes two threats at once. As O, answer a corner with the center and the center with a corner, and never take a corner after X's opposite-corner trap.
None of this is folklore. Every number below comes from a program that searches the whole game with the same rules code that runs Poozee's Tic-Tac-Toe, and a test fails if the article and the code ever disagree. Squares are named the way you see them: top left, center, bottom middle and so on.
Why perfect play is always a draw
Tic-tac-toe is small enough to check completely. Counting every order of moves until someone wins or the board fills up, there are 255,168 possible games: X wins 131,184 of them, O wins 77,904 and 46,080 are draws. Only 5,478 different positions can ever appear on the board, and just 765 of them are really different once you count rotations and mirror images as the same.
Those game counts make X look like a big favorite, but they include every careless game. The real question is what happens when both sides play their best. Working backward from each of the 958 finished positions (a method called minimax), the answer is a draw: from the empty board, and after every one of the nine first moves. Neither player can force a win, so wins only come from mistakes.
The fastest possible win takes five moves, X's third mark, and 1,440 of the 255,168 games end that quickly.
Forks: how games are actually won
A fork is a move that creates two threats at once, two lines that each need just one more mark. Your opponent can block one, and you win with the other.
X now has two marks in the left column and two on the diagonal from the bottom left to the top right, with the last square of each still empty. Against a player who always takes a win and always blocks, a fork is the only way to win, because every single threat gets blocked. So everything in this guide is about one thing: steering the game toward a position where you can fork and your opponent can't stop it.
How to win as X
Open in a corner
The center is part of four lines, a corner three and an edge two, so the center looks strongest. But every opening draws with perfect play, so what matters is how many ways your opponent can go wrong. To measure that, we pitted each opening against two imperfect opponents:
- Random player: picks any empty square, each equally likely.
- Blocker: takes a win when it has one, otherwise blocks your threat when you have one (picking either at random if you have two), otherwise picks any empty square.
In both cases X plays safely (never a move that would lose to perfect play) and, among safe moves, picks the one with the best chance to win. The chances below are exact, worked out over every possible game rather than sampled, and X never loses any of them.
| First move | X wins vs random player | X wins vs blocker | O's replies that don't lose |
|---|---|---|---|
| Corner | 99.5% | 92.7% | 1 of 8 |
| Edge | 98.7% | 84.9% | 4 of 8 |
| Center | 99.0% | 83.3% | 4 of 8 |
The corner wins because it leaves O exactly one safe answer. Against the center, any of the four corners holds the draw, so even a random reply is safe half the time.
If O doesn't take the center, you can force a win
After a corner opening, all seven replies other than the center lose. Say O takes the top middle, next to your corner:
The cleanest line is the center. It threatens the bottom right to complete the diagonal, O has to block there, and then the bottom left makes the fork from the first diagram: the left column and the rising diagonal at once.
If O takes the center, set a trap
O's center reply holds the draw, but you still have two good tries. Against the blocker, here is how often each second move for X wins:
| X's second move (after top left and O's center) | X wins vs blocker |
|---|---|
| Far edge (middle right or bottom middle) | 41.7% |
| Opposite corner (bottom right) | 33.3% |
| Next to your corner (top middle, top right, middle left, bottom left) | 0.0% |
The squares next to your corner make a threat right away, the blocker simply blocks it, and your chances are gone. The quieter moves work better. After the far edge, O loses with the middle left or the bottom left: both let you take the top right corner, which lines up the top row and the right column at once.
The opposite corner is the famous trap, and it's the one to learn first because it catches people so often.
The opposite-corner trap
X takes a corner, O takes the center, and X takes the corner straight across. O now has two natural-looking replies, the two remaining corners, and both lose. The four edges hold the draw.
Here is why a corner loses. Say O takes the top right. Now O threatens the diagonal down to the bottom left, so X must block there, and that block is a fork:
O takes an edge instead, and X has to block that threat, so X never gets time to fork. If you're X, the trap costs you nothing: an edge answer is still a draw. If you're O, burn one rule into memory: after X's opposite corner, play an edge.
How to play O: the answer to every opening
As O you can't force a win, but you never have to lose. There's one safe family of answers to each first move:
| X opens | Replies that draw | Replies that lose | O wins vs blocker, best safe reply |
|---|---|---|---|
| Corner | The center | All 7 others | 5.7% |
| Center | Any corner | Any edge | 5.7% |
| Edge | The center, the two corners beside X, the opposite edge | The other two edges, the two far corners | 51.4% (a corner beside X) |
An edge reply to the center loses to almost anything: if O answers with the top middle, X wins by force with every move except the bottom middle. And watch for the center version of the trap. If X opens in the center, you take the top left and X takes the bottom right, all four edges lose: take one of the two remaining corners.
The last column of the table shows where O's real chances are. Against a corner or the center, O wins only 5.7% of games even against the blocker. An edge opening is X's gift to you: take a corner beside X's mark and the blocker loses 51.4% of the time. Against a blocker that also picks its first square at random, a well-played O wins 26.0% of games, and against a fully random X it wins 91.6%.
Practice against the computer
Poozee's Tic-Tac-Toe has three levels that line up with this guide:
- Easy takes a win only three times in four and blocks only half the time, so it's good for practicing forks from any position.
- Medium always wins when it can and always blocks, then takes the center, then a corner, then an edge. It never looks for forks, so it walks into the opposite-corner trap every time: play the top left, let it take the center, play the bottom right, and it answers with a corner.
- Hard has solved every position, so it never loses: a draw is a good result. Among equally safe moves it picks the one with the best chance to beat a player who only blocks, so it opens in a corner too.
Tap Hint whenever you're unsure. It shows the best move with a short reason, such as "it blocks O's top row" or "it makes a fork", so you learn the patterns as you play.
If you like games that come down to making two threats at once, the same idea wins at a bigger scale in how to win Connect Four.
Keep playing
- Play Tic-Tac-Toe against the computer or a friend
- Play Four in a Row, tic-tac-toe's big cousin
- How to win at checkers
- Chess openings for beginners
Frequently asked questions
Is there a way to always win at tic-tac-toe?
No. If neither player makes a mistake, every game is a draw, and a search of all 255,168 possible games confirms it. You win by giving your opponent chances to go wrong: open in a corner and aim for a fork.
What is the best first move in tic-tac-toe?
A corner. Every first move draws with perfect play, but after a corner only one reply (the center) saves O. Against a player who always blocks but never sees a fork coming, a corner opening wins 92.7% of games, against 84.9% for an edge and 83.3% for the center.
How do you win tic-tac-toe when you go second?
Against a perfect X you can't, but you never have to lose. Answer a corner with the center, the center with a corner, and an edge with a corner next to it, then wait for X to leave you a fork.
What is a fork in tic-tac-toe?
A move that gives you two different ways to win on your next turn. Your opponent can block only one of them, so you complete the other. Against a player who never misses a block, a fork is the only way to win.