How to Play Tic-Tac-Toe Perfectly (Never Lose)

Colorful board game tiles scattered on a wooden table, offering copy space.

Tic-tac-toe is mathematically solved. With perfect play from both sides, every game ends in a draw, and a player who plays optimally never loses. The optimal strategy is short enough to memorize in one sitting. Here’s the move-by-move guide for guaranteeing at least a draw as X or O, the fork-creation tactic that wins against weaker players, and the specific traps to set up and avoid.

Key takeaways

  • Tic-tac-toe is a solved game; with optimal play from both sides, every match ends in a draw.
  • For X (first player), the strongest opening move is a corner — it gives the most winning paths and fork opportunities.
  • For O (second player), responding to a corner opening requires playing the center, full stop.
  • “Forks” — positions where you threaten two winning lines at once — are the only way to win against a careful opponent.
  • An unbeatable strategy follows a priority order: win, block, fork, block fork, center, opposite corner, empty corner, empty side.

The board and notation

Tic-tac-toe is played on a 3×3 grid. We’ll number the squares 1-9, like a phone keypad:

1 | 2 | 3
---------
4 | 5 | 6
---------
7 | 8 | 9

Square 5 is the center. Squares 1, 3, 7, 9 are corners. Squares 2, 4, 6, 8 are edges (or sides). X moves first by convention; O moves second. The first player to complete a horizontal, vertical, or diagonal three-in-a-row wins. If all nine squares fill without a winner, the game is a draw.

Why corners are stronger than edges

A corner square participates in three potential winning lines (one row, one column, one diagonal). An edge square participates in only two (one row or column, no diagonal). The center participates in four. Corners are the second-strongest type of square and the best opening move for X because their winning-line participation creates more fork opportunities than edges.

A full search of the game tree (small enough for any computer to finish instantly) confirms that X playing any corner leaves O a single non-losing response: the center. Any other O response loses to optimal X play.

Optimal opening moves

X’s first move

Play a corner. Any corner. They’re symmetrically equivalent. Square 1 is conventional but every corner is identical in effect. Every first move draws with perfect play, so the center is also safe; the corner is the practical choice because it leaves O only one correct reply.

O’s response

If X plays a corner, O must play the center (square 5). Any other response — another corner, an edge — loses to optimal X play. The center denial is the only draw-preserving move.

If X plays the center, O should play a corner. Any corner works.

If X plays an edge (a weaker opening), O has four draw-preserving responses: the center, either of the two corners next to X’s edge, or the opposite edge.

The unbeatable strategy (Newell and Simon)

This priority list is the one used in Newell and Simon’s 1972 tic-tac-toe program. On each turn, evaluate moves in this priority order and play the first one that’s available:

  1. Win. If you can complete three-in-a-row, do it.
  2. Block. If the opponent can complete three-in-a-row next move, block them.
  3. Fork. Make a move that creates two simultaneous threats (two ways to win next move).
  4. Block fork. If the opponent could create a fork on their next move, prevent it. Sometimes this requires creating your own threat to force the opponent to defend.
  5. Center. Play the center if available.
  6. Opposite corner. If the opponent occupies a corner, play the opposite corner.
  7. Empty corner. Play any empty corner.
  8. Empty edge. Play any empty edge.

Apply these in order, every turn, and you will never lose. Against an opponent who deviates from optimal play, you will often win.

The fork: how to actually win

A fork is a position where you have two open three-in-a-row threats simultaneously. The opponent can only block one. On your next move, you complete the other for the win.

Example fork setup as X

Move 1: X plays corner 1. Move 2: O plays edge 2 (a mistake — they should play center). Move 3: X takes the center, square 5. That threatens the 1-5-9 diagonal, so O is forced to block at 9.

Move 5: X plays corner 7, creating a fork: threats on column 1-4-7 and diagonal 3-5-7. O can only block one. X wins.

The pattern: make a threat that forces your opponent’s reply, then use your free move to create two threats at once. Be careful with the obvious-looking corner 9 on move 3 here: it lets O take the center with a threat of their own, and the game fizzles into a draw.

Common opponent mistakes and how to punish them

O plays a corner instead of center

X opens with corner 1. O plays corner 3 (wrong). X plays the opposite of O’s corner — corner 7. Now X has two pieces (corners 1 and 7) on the same column. O must block at edge 4. X plays corner 9 to create a fork: diagonal 1-5-9 threat and row 7-8-9 threat. O can only block one. X wins.

O plays an edge

X opens with corner 1. O plays edge 2 (wrong). X has three winning continuations: the center (5), the far corner on the same side (7), or the edge 4. Each one forces O to block and sets up a fork, as in the example above. The principle holds for every edge reply: edge responses to corner openings lose against accurate play.

X plays an edge first

If you’re playing as O and X opens with an edge (a mistake), play the center. From the center, you can usually force a draw and sometimes find a winning fork as O — though the latter requires X to make additional mistakes.

The complete game tree for X’s corner opening

Tic-tac-toe has 255,168 possible games (counting every move order), or 26,830 once rotations and reflections are treated as the same, and only 138 distinct finished positions up to symmetry. From the corner opening, the game tree narrows quickly:

  • X corner → O center → draw under optimal play (X cannot force a win).
  • X corner → O opposite corner → X can force a win.
  • X corner → O adjacent corner → X can force a win.
  • X corner → O edge → X can force a win.

So an X player opening with a corner wins against any non-center O response. The opening corner is the strongest first move possible.

When you’re playing as O

Your job is to not lose. Optimal play guarantees a draw. The key moves:

  • If X plays a corner, play the center. Always.
  • If X plays the center, play any corner. Don’t play an edge.
  • If X plays an edge, play the center. This is your highest-percentage response.
  • Follow the Newell-Simon priority list on every subsequent turn.

O cannot win against an X player who knows the strategy. Against a careless X, O can occasionally create forks of their own, but the second-player disadvantage makes wins rare.

Practice patterns

Two drills to internalize the strategy:

The corner opening drill (as X)

Play 20 games as X, always opening with corner 1. Make a friend or family member play as O without telling them the strategy. Count how many you win. Once you’ve internalized the fork patterns, you’ll win a good share of games against opponents who don’t know the corner-center rule.

The center-block drill (as O)

Play 20 games as O, always responding to X’s corner with the center. Follow the Newell-Simon priority list rigorously. You should draw 100% of the time against a knowledgeable X player and draw or win against weaker X players.

A perfect computer opponent makes a good sparring partner. Our tic-tac-toe game has an Impossible CPU level (plus Easy and Hard): against Impossible, your best result is a draw, and any slip gets punished, which is exactly how you learn the optimal moves.

Variants where perfect play looks different

Standard 3×3 tic-tac-toe is solved. Larger boards and rule variants change the math substantially:

  • 5×5 with 4-in-a-row. Still a draw with perfect play; the extra space mostly gives both sides more room to block.
  • Gomoku (5-in-a-row on a 15×15 or larger board). First player has a forced win with optimal play.
  • Ultimate tic-tac-toe. Nine boards inside one board; not solved in practice and far more strategic.
  • Misère tic-tac-toe. The first player to get three-in-a-row loses. Different optimal strategy entirely.

For more strategic depth, our Ultimate Tic-Tac-Toe guide covers the nine-board variant; for related games, see our games like tic-tac-toe list.

Frequently asked questions

Is it possible to win at tic-tac-toe?

Yes, against a player who doesn’t know the optimal strategy. Against a player who follows the optimal priority list, the game always ends in a draw. The first player (X) has a slight advantage because corner openings create more fork opportunities.

What’s the best first move in tic-tac-toe?

A corner. All four corners are symmetrically equivalent. Corner openings create more potential winning lines than edge openings and force the second player into a single non-losing response (the center).

Can tic-tac-toe end in a draw with perfect play?

Yes. When both players follow the optimal strategy, every game of standard 3×3 tic-tac-toe ends in a draw. The game is mathematically classified as a draw under perfect play.

What is a fork in tic-tac-toe?

A position where you have two open three-in-a-row threats simultaneously. The opponent can only block one threat per turn, so you win by completing the other on your next move. Creating forks is the only way to actually win against a defensive opponent.

Why do computers always draw at tic-tac-toe?

Because both computer players follow the optimal strategy. Tic-tac-toe is one of the simplest solved games — modern AI can compute the perfect move tree in milliseconds, and two perfect players always draw.

The bottom line

Tic-tac-toe is solved, but most opponents haven’t solved it. Memorize the Newell-Simon priority list (win, block, fork, block fork, center, opposite corner, empty corner, empty edge). Open with a corner as X. Respond to X’s corner with the center as O. Look for fork opportunities every turn. Following these rules, you will never lose — and against unprepared opponents you’ll win more than you’d expect. For a game that’s genuinely impossible to perfectly solve in your head, the Chrome Dino game is in the next tab.

Related guides

🔌 Connect any AI assistant to dinogame.gg — we run an MCP server: https://dinogame.gg/mcp