How to Play Tic-Tac-Toe | Perfect Strategy, Forks & Why It Always Draws
The first strategy game everyone learns, and one that almost nobody plays perfectly.
Play Tic-Tac-ToeWhat Is Tic-Tac-Toe?
Tic-Tac-Toe (also called Noughts and Crosses or Xs and Os) is a two-player game on a 3×3 grid. Players take turns placing their mark, X or O, in an empty square. The first player to get three marks in a row (across, down or diagonally) wins. If all nine squares fill up with no winner, it's a draw.
Tic-Tac-Toe has a special place in game theory as one of the simplest games to be completely "solved." With best play from both sides, every game ends in a draw. That makes it a good first lesson in strategic thinking. Forcing moves, controlling space and creating forks all turn up again in chess, Go and most other strategy games.
The Board & Basic Rules
The board has nine squares, which strategists sort by type.
- Center. The single middle square. It's part of four possible winning lines (both diagonals, the middle row and the middle column).
- Corners. The four corner squares. Each is part of three winning lines (one row, one column, one diagonal).
- Edges. The other four squares (top-center, left-center, right-center, bottom-center). Each is part of only two winning lines.
X always goes first. That gives X a small structural edge. It isn't enough to force a win against perfect defense, but it's enough to steer the early game.
Winning lines. There are exactly eight possible winning lines, made up of three rows, three columns and two diagonals. Every decision in the game comes down to controlling, threatening or blocking these lines.
Perfect Play as X (First Player)
If you're X, this strategy guarantees you either win or draw. You won't lose.
Move 1. Take the center. The center is the strongest opening. It sits on four winning lines and keeps the most options open for every move that follows.
Move 2, after O responds.
- If O takes a corner, take the opposite corner. This sets up a possible fork (explained in the next section).
- If O takes an edge, you have a winning strategy. Take a corner next to the edge O chose, then create a fork on your next move. Against an edge reply, X can always force a win with correct play.
Move 3 onwards. Look for a fork (two separate threats at once). If there isn't one, look for a win, then block O's win, then take the best square left (corners before edges).
The center opening doesn't guarantee a win, but it makes any mistake by O fatal. Against perfect play from O, the center opening draws. Against imperfect play, it wins.
Perfect Play as O (Second Player)
Playing O is pure defense. Your goal is to survive to a draw. Here's how.
If X opens center (the most common and strongest opening).
- Take a corner. This is the only reply that guarantees a draw. Taking an edge against a center opening lets a skilled X player force a win.
- After taking a corner, play defensively. Block every winning threat X creates, and avoid positions where X can fork you.
If X opens corner.
- Take the center. This is mandatory. If O doesn't take the center after a corner opening, X can set up a fork you can't stop.
- Once you have the center, prefer edges that block X's diagonal threats.
If X opens edge.
- Take the center. Again, the center is the all-purpose defensive anchor. From there, respond to what X does.
The lesson is that the center is the key defensive square. If X doesn't take it, O must. A game where neither player takes the center is strategically odd, and it almost always ends in a draw through confusion rather than skill.
How Forks Win Games
A fork is a position where you have two separate threats to win, meaning two different lines that each need just one more mark. Your opponent can block only one threat per turn, so a fork wins the game.
Example. X holds the top-left and bottom-right corners, and it's X's turn. If X takes the bottom-left corner, X now threatens the left column and the bottom row. If both threats are live, O can block only one, and X wins on the other.
How to create forks.
- Hold two intersecting winning lines with one mark each. Your next move should create both threats at the same time.
- Opposite corners are the classic fork setup. If X has two opposite corners and the center, almost any follow-up creates a fork.
- Look for a square that sits on two of your partly filled lines.
How to prevent forks.
- Don't let your opponent hold two intersecting lines unchallenged.
- Keep your opponent busy with immediate threats. If they're blocking your single-line threats, they can't set up forks.
- If your opponent has two corners and the center, you're probably already in fork territory. The time to stop a fork is before it's set up.
Why Perfect Play Always Draws
Tic-Tac-Toe was one of the first games to be solved by computer analysis. The result is that with perfect play from both players, the game is always a draw. Here's the intuitive reason why.
- X has the first-move advantage and can always at least draw.
- O, by answering X's opening with the right defensive move (corner against center, center against corner or edge), can always stop X from making a fork.
- Without a fork, X can never make two threats at once, and O can block every single threat.
- With both players blocking and counter-blocking correctly, the board fills up with no winner. Draw.
That means two things for your own play. As X, you can never lose unless you make a mistake. As O, you can always draw unless you make a mistake. The game is entirely about punishing your opponent's errors.
Being "solved" makes Tic-Tac-Toe a neat case study in game theory. The same method (map every possible move, evaluate the outcomes, find the dominant strategies) applies to far more complex games. Tic-Tac-Toe is just small enough to solve completely by hand.
The Priority System
When it's your turn, check moves in this order and take the first one that applies.
- Win. If you can make three in a row, do it. Obvious, but easy to miss when you're busy planning something clever.
- Block. If your opponent can win on their next move, block them. Missing a block is the most common mistake at every level.
- Fork. If you can create a fork (two threats at once), take it. It guarantees a win.
- Block opponent's fork. If your opponent is about to create a fork, stop it. Either take the forking square yourself, or force them to block a threat of yours in a way that doesn't complete their fork.
- Center. If the center is free, take it.
- Opposite corner. If your opponent holds a corner and the diagonally opposite corner is empty, take it.
- Any corner. Corners are better than edges.
- Any edge. Last resort.
Follow this order and you will never lose a game of Tic-Tac-Toe. Against opponents who don't follow it, you'll win often.
Playing Against AI
Our Tic-Tac-Toe engine uses the minimax algorithm. It evaluates every possible game state and always picks the best move. That has four consequences for you.
- You cannot beat it. The best result against our AI is a draw. If you draw against it every time, you're playing perfectly.
- Use it for practice. When you lose to the AI, study the board. Where did the fork come from, and which of your moves let the AI set it up? Learning to hold a perfect opponent to a draw makes you much harder to beat in games against people.
- Try different openings. As X, open center and watch how the AI responds. Then try a corner opening. Notice how its defense changes.
- Play as O. Defending as the second player is harder than attacking as the first. Practice surviving the AI's best X strategy.
Think of the AI as a sparring partner. Every loss shows you a pattern you didn't see.
Where to Go After 3×3
Once you've got 3×3 down, its ideas (controlling key squares, building forks, answering threats) carry straight over to more complex games.
- Connect Four. The same idea of winning by alignment, but on a 7×6 grid with gravity. Far more complex, but forks and double threats are still how you win.
- Gomoku / Five in a Row. Place stones on a grid to get five in a row. On a 15×15 or 19×19 board, the strategic depth is enormous.
- Ultimate Tic-Tac-Toe. A 3×3 grid of 3×3 boards. Win a small board to claim that square on the big board, and win three big-board squares in a row to win the game. Much harder to solve, and properly deep.
- Chess and Go. The same principles Tic-Tac-Toe introduces (spatial control, forced sequences and thinking ahead), taken about as far as they go.
Tic-Tac-Toe is where strategy games start. Learn it properly and you'll recognize its ideas in every strategy game you pick up afterwards.
Try these strategies in a free game of Tic-Tac-Toe.