Tic-tac-toe looks like the simplest game in the world: a grid of nine squares, two players, X and O, and the first to get three in a row wins. Almost everyone learns it as a child. But there is a real strategy behind it, and once you understand it you will never lose a game again. You will also start winning against friends who think they know it already. In this guide we explain the ideas in plain language, then walk through every common opening. You can try each idea straight away in our free browser game:
The rules in 30 seconds
- Players take turns placing their mark, X or O, in an empty square. X usually goes first.
- The first player to get three marks in a row, across, down or diagonally, wins.
- If all nine squares are full and nobody has three in a row, the game is a draw.
There are eight winning lines in total: three rows, three columns and two diagonals. Everything in tic-tac-toe strategy comes from counting how many of those eight lines each square belongs to.
Why the centre and corners matter
Not all squares are equal. Look at how many winning lines pass through each one:
- The centre is part of 4 lines: the middle row, the middle column and both diagonals.
- Each corner is part of 3 lines: one row, one column and one diagonal.
- Each edge (the middle square of a side) is part of only 2 lines: one row and one column.
A square that belongs to more lines gives you more ways to win and more ways to block. That is why the centre is the most powerful square, corners are next, and edges are the weakest. When you are not sure what to do, a good rule is: centre first, then corners, then edges.
The priority list for every move
Strong players check the same list, in the same order, on every single turn. If you do this, you will never lose:
- Win: if you have two in a row with the third square empty, take it and win.
- Block: if your opponent has two in a row with the third square empty, take that square.
- Fork: make a move that creates two winning threats at once.
- Block a fork: if your opponent could make a fork next turn, stop it, ideally by making a threat of your own that forces them to respond.
- Centre: take the centre if it is free.
- Opposite corner: if your opponent is in a corner, take the corner opposite it.
- Empty corner: take any free corner.
- Empty edge: take any free edge.
Most lost games happen at step 2. Players get excited about their own plan and forget to check whether the opponent is one move from winning. Make "can they win next move?" a habit before every move.
Understanding the fork
A fork is the only way to win against an opponent who always blocks. You place a mark that creates two lines that each need just one more mark. Your opponent can block one line, but not both, so you complete the other and win.
For example, imagine you are X with marks in the top-left and bottom-right corners, and O is in the centre. If the top-right and bottom-left corners are free and the right column and top row have no O marks, placing X in the top-right corner threatens both the top row and the right column. O can only block one of them.
The whole art of tic-tac-toe is setting up forks for yourself while making sure your opponent never gets the chance to make one.
Playing first as X
Opening in a corner (the trickiest choice)
A corner opening gives your opponent the most ways to make a mistake. There is only one safe reply for O: the centre. Every other reply loses against correct play.
- If O takes an edge: you can force a win. A strong plan is to take the centre next. O must block your diagonal, and you can then create a fork.
- If O takes the opposite corner or an adjacent corner: you can also force a win by taking another corner and setting up a fork.
- If O takes the centre: the game should be a draw. A good try is to take the corner opposite your first mark. If O now replies in a corner, O has made a mistake: block the threat, and your blocking move creates a fork that wins. If O correctly replies on an edge, block when needed and the game ends in a draw.
Opening in the centre (the safest choice)
The centre is easy to play and still sets traps. O's best reply is a corner. If O takes an edge instead, you can force a win: take a corner that creates a threat, force O to block, and then fork.
If O replies in a corner, take the corner opposite O's mark. O now has to be careful, because a careless edge move can let you fork. With correct play from both sides, the game ends in a draw.
Opening on an edge
An edge opening is the weakest start, but it still cannot lose against perfect play and it can confuse players who are used to corner and centre openings. Play it for fun once you know the main lines well.
Playing second as O
As the second player you cannot force a win against a perfect opponent, so your first goal is to never lose. Follow these replies:
- X opens in a corner: take the centre. Always.
- X opens in the centre: take a corner. Never an edge.
- X opens on an edge: take the centre, or a corner next to X's mark.
After your first move, follow the priority list. One important trap to know: if X has two opposite corners and you are in the centre, do not take a corner. Take an edge instead. This forces X to block you and stops X from making a fork. Many players lose this exact position because "corners are better" usually feels right.
Tic-tac-toe is a "solved" game: people have checked every possible position. There are 255,168 possible sequences of moves from an empty board to the end of a game. When both players always pick the best move, every one of the best lines ends in a draw. That is why tic-tac-toe is often used to teach computer programming and game theory.
The five most common mistakes
- Not blocking: missing that the opponent has two in a row.
- Answering a corner with an edge: the classic beginner's mistake as O.
- Taking a corner against two opposite corners: it lets X fork. Take an edge instead.
- Playing too fast: each game is short, so it is tempting to tap quickly. Take two seconds to check the list.
- Playing the same opening every time: regular opponents learn your moves. Mix corner and centre openings.
How to practise
Because games are so short, you can practise a lot in a few minutes. Try this routine:
- Play five games as X starting in a corner. Try to win every game where your opponent does not take the centre.
- Play five games as O. Your only goal is to never lose.
- Play five games starting in the centre, looking for fork chances on every move.
Our game lets you play quick rounds right in your browser, on a phone or a computer, with no download. If you want to play a friend, sit together and take turns on the same screen, or simply draw a grid on paper and test each other.
Playing against the computer
Most tic-tac-toe games, including ours, let you play against the computer. Computer opponents usually come in difficulty levels, and they behave very differently:
- Easy opponents often pick random squares. They are perfect for practising forks, because they rarely block the right square.
- Medium opponents usually block your obvious threats but miss forks. Try to set up a fork in every game.
- Hard opponents play perfectly. You cannot beat them, so the goal is to never lose. If you draw ten games in a row against a hard computer, you have truly mastered the game.
A useful exercise is to lose on purpose against the hard level and watch how it wins. You will see the forks it creates and learn to spot them in your own games.
Variations that keep it interesting
Once regular games always end in a draw, try one of these popular variations with a friend on paper:
- Ultimate tic-tac-toe: a big 3 x 3 board where every square holds its own small tic-tac-toe game. The square you play in a small board decides which small board your opponent must play in next. It is surprisingly deep.
- Misere tic-tac-toe: the rules are reversed, and the player who makes three in a row loses. Your instincts will keep trying to win, which makes it a fun brain teaser.
- 4 x 4 tic-tac-toe: a bigger board where you need four in a row. There are many more positions, so forks are harder to see.
- Three-piece tic-tac-toe: each player has only three marks. After placing all three, you move one of your existing marks to an empty square instead of adding a new one. Games no longer fill up, so somebody usually wins.
Teaching tic-tac-toe to children
Tic-tac-toe is often the very first strategy game a child learns, and it teaches useful thinking skills: taking turns, looking at the whole board and thinking one move ahead. When you play with a young child, let them win sometimes, then gently point out a block they missed: "Look, if I go here, I get three in a row. Where could you go to stop me?" Over a few games they start checking for threats on their own, which is exactly the habit that strong players have.
Older children enjoy learning the fork. Show them one example, then challenge them to set one up against you. Once they discover that every perfect game is a draw, many children become curious about why, which is a lovely introduction to logic and maths.
Beyond three in a row
Once tic-tac-toe becomes too easy, the same ideas of lines, threats and forks appear in bigger games. Connect-four style games and gomoku (five in a row on a large board) are much harder and cannot be solved in your head. Chess uses forks too: a knight attacking two pieces at once is the same idea as a tic-tac-toe fork. If you enjoy thinking ahead, read our beginner's guide to chess next, or try a game of Ludo with the family.