All Guides
📖 Guide🎮 Tic Tac Toe

Tic Tac Toe: Beat the AI & Win Every Time

Learn the unbeatable Tic Tac Toe strategy for going first or second. Master the corner opening, centre response, and all win/draw patterns.

Tic Tac Toe is a solved game — with perfect play from both sides, every game ends in a draw. But the AI on hard difficulty plays perfectly, and so must you. This guide teaches you exactly what perfect play looks like for both the opening player (X) and the second player (O), so you can draw against hard AI and win against anything easier.

Getting Started

The board is a 3×3 grid. Players take turns placing their mark (X or O). The first to get three in a row — horizontal, vertical, or diagonal — wins. If all nine squares are filled with no winner, the game is a draw.

Controls:

  • Click or tap any empty square to place your mark.
  • Choose your difficulty before the game starts.
  • After a game ends, tap “Play Again” to start a new round.

Difficulty overview:

  • Easy — the AI plays randomly; you can win almost every game.
  • Medium — the AI plays smart but misses some traps.
  • Hard — the AI plays perfectly; best outcome for a skilled player is always a draw.

Core Mechanics Explained

The Win Conditions

There are eight possible winning lines on a 3×3 board: three rows, three columns, and two diagonals. You win by completing any one of these lines before your opponent does.

Why Perfect Play Draws

With both players playing optimally, every game is a draw. This is a mathematical fact — Tic Tac Toe is “strongly solved.” The AI on Hard knows every optimal response to every position. Your goal against Hard is to match perfect play and force the draw.

The Strategic Value of Squares

Not all squares are equal:

  • Centre — the single most powerful square; it is part of four winning lines (two diagonals, one row, one column).
  • Corners — each corner is part of three winning lines. Corners are second in value.
  • Edges — the four non-corner edge squares are part of only two winning lines. They are the weakest positions.

Tips & Strategies

Going First — The Corner Opening

The strongest opening when you go first is a corner square. This immediately creates two winning threats that the opponent must address. After placing in a corner:

  1. If the opponent plays centre, take the opposite corner. This sets up a fork.
  2. If the opponent plays edge, take the opposite corner and then a third corner on the next move to set up a fork.
  3. If the opponent plays another corner, take the centre and defend carefully.

The corner opening is harder for a non-perfect opponent to defend against than the centre opening.

The Centre Opening

Taking the centre is also very strong. It is part of four lines, making it the most versatile square. Against a weaker opponent, the centre opening wins frequently. Against a perfect player, however, the centre opening is easier to draw against than the corner — a skilled second player who takes a corner can always force a draw from there.

Going Second — Take the Centre

If your opponent opens in a corner, the strongest response is the centre. This neutralises their two-fork setup. From the centre, you can always draw.

If your opponent opens in the centre, take a corner. Do not take an edge — an edge response to a centre opening gives the first player winning opportunities.

Forcing a Fork

A fork is a position where you have two simultaneous winning threats, forcing your opponent to block one while you complete the other. Forks cannot be stopped. Creating a fork is how you win when both players are still playing, rather than waiting for your opponent to blunder.

A fork requires three of your pieces in an L or diagonal arrangement with two open winning lines. The classic setup: corners at positions (1,1) and (3,3) with your centre at (2,2) gives you a fork threat that most Easy opponents cannot stop.

Advanced Techniques

Blocking While Threatening

The best moves in Tic Tac Toe are the ones that simultaneously block an opponent’s threat and create one of your own. Never make a pure blocking move when a dual-purpose move is available. Scan the board after each opponent move: is there a square that blocks them AND advances one of your lines?

Reading the AI on Medium

Medium difficulty misses certain traps. Set up positions where you have two separate ways to win (not a fork, but two independent long-term threats) and Medium AI often defends one while letting the other develop.

The Edge Trap on Easy

Easy AI plays randomly. If you open with a corner and the AI does not take the centre, take the opposite corner immediately. This creates a diagonal that the AI is statistically unlikely to block correctly, and you often win in five moves.

Recognising Drawn Positions

Once you can identify positions that are mathematically drawn — specifically, positions where no fork is possible for either player — you can stop worrying about losing and focus on managing the draw. Any board where both players have one piece each with the centre and both diagonals partially contested is typically heading to a draw.

Common Mistakes to Avoid

  • Opening on an edge. Edge openings are the weakest start. Use corners or centre.
  • Responding to a corner opening with an edge. Against a corner-opening opponent, play centre. An edge response gives your opponent easy fork opportunities.
  • Missing a fork. Before making any move, check whether your current position already allows a fork. If it does, complete it immediately.
  • Failing to block a fork. When you see your opponent setting up a fork (two non-conflicting threats developing), block it by playing the intersection square, or create an immediate win of your own.
  • Assuming a draw is a loss. On Hard difficulty, a draw is the correct outcome. Do not feel pressured to take risks trying to win — play the perfect draw line and be satisfied with the result.

Final Thoughts

Tic Tac Toe is a game with a perfect strategy you can memorise. Corner opening, centre response, fork awareness — these three ideas cover the vast majority of the game’s strategic content. Once you know them cold, you will never lose to any opponent, and you will consistently draw against perfect play. For casual play, the real fun is trying to outfox a friend who has not read the guide, using fork setups that look innocent until the moment they cannot be stopped. Take the corner, control the centre, and play the traps — the board is yours.