Tic Tac Toe

Play Tic Tac Toe online: get three in a row before your opponent does. Face a friend on the same screen, or test yourself against a computer that plays perfectly.

1Choose computer or 2-player mode
2Tap an empty square to place your mark
3Line up three in a row to win the round

Your move — you are X.

0X wins
0O wins

Private by design: 100% in your browser — nothing is uploaded, no sign-up. This game runs entirely on your device.

Tic Tac Toe looks like a children's game, and in one sense it is: the board has nine squares, the rules take ten seconds to explain, and a round is over in under a minute. But hidden inside that little grid is one of the most instructive games ever devised. It is small enough to solve completely — every possible game has been counted and analysed — yet rich enough that beginners still lose to the same two tricks for years. This page gives you both ways to enjoy it: a relaxed two-player mode for passing a phone back and forth, and a computer opponent that plays perfectly, so every draw you earn against it is honestly earned.

The computer's perfection is not a trick or a lookup of canned moves. On every turn it looks ahead through all possible continuations of the game — a technique called minimax — and picks the move with the best guaranteed outcome. Because Tic Tac Toe is a solved game, that search always finds a line that avoids defeat. When you make a mistake, it will punish it; when you play flawlessly, it will settle for the draw it cannot improve on. Playing against it is the fastest way to internalise the strategy below, because the feedback is immediate and completely unforgiving.

Strategy that actually works

Start with the opening. The centre square is the strongest first move: it belongs to four of the eight winning lines, while a corner belongs to three and an edge to only two. If your opponent takes the centre, answer in a corner — answering in an edge is the one opening mistake that a good player can turn into a forced win. From there, the game is mostly about threats. Always complete your own line when you can, always block an opponent's two-in-a-row, and after those two duties are done, look for the move that quietly creates two threats at once.

That double threat is called a fork, and it is the real weapon of Tic Tac Toe. A fork move leaves you one move away from winning in two different lines; your opponent can only block one square, so the other line completes next turn. Most games between beginners are decided by forks nobody noticed. The defence is to spot fork squares before they are played: if a square would give your opponent two separate two-in-a-rows, take it yourself or force them to defend somewhere else. Against the computer on this page, avoiding forks is exactly the skill that converts losses into draws.

The eight ways to win

Line typeLinesNote
RowsTop, middle, bottomThe first lines beginners learn to watch
ColumnsLeft, centre, rightEasy to overlook when a game speeds up
DiagonalsTwo, corner to cornerBoth pass through the centre — another reason it is prized

Notice what the table implies: the centre sits on four lines, each corner on three, and each edge on two. That arithmetic is the whole opening theory of the game in one glance, and it explains why perfect play from both sides ends in a draw — the first player's edge in options is exactly balanced by the second player's ability to answer each threat in turn.

One more habit separates strong players from hopeful ones: count the empty squares before you move. Late in the game there may be only one square that does not lose on the spot, and finding it requires looking two moves ahead rather than reacting to the last mark placed. That tiny pause — checking your own threat, their threat, and the fork squares, in that order — is the entire discipline of the game, and it transfers surprisingly well to larger strategy games where the same three questions are asked on a much bigger board.

Rounds here are instant and the tally keeps score across a whole match, so a best-of-ten with a friend takes a few minutes. If you prefer your contests against the clock and your own memory instead, the memory game is waiting; for a longer strategic session, try building tiles in the 2048 game.

Frequently asked questions

Can I play Tic Tac Toe against the computer?

Yes. Choose "Against the computer" and you play X while the computer answers as O. The computer uses a perfect strategy (it evaluates every possible continuation), so it never loses — the best result available is a draw, and earning one is a genuine achievement.

How does the 2-player mode work?

Two people share the same screen and take turns tapping empty squares — X always goes first. The score tally tracks wins for X, wins for O and draws across as many rounds as you play.

Who goes first in Tic Tac Toe?

X always makes the first move, here and by convention almost everywhere. Going first is a real advantage: with perfect play from both sides the game is a draw, but the second player has far less room for mistakes.

What is the best first move?

The centre is the strongest opening because it takes part in four of the eight winning lines; a corner is next best with three. An edge square is the weakest start, joining only two lines, and gives the second player the easiest path to a draw.

Can the computer be beaten?

No. Tic Tac Toe is a solved game and the computer plays perfectly, so it will win whenever you make a mistake and draw otherwise. Treat each draw as a win for you — it means you played a flawless round.

How many possible games of Tic Tac Toe are there?

There are 255,168 possible game sequences if you count every order of moves, but only 26,830 genuinely different games once rotations and reflections of the board are treated as the same. Of all sequences, the first player wins about 51%, the second about 31%, and roughly 18% are draws — assuming random play, not perfect play.

What is a fork in Tic Tac Toe?

A fork is a move that creates two separate threats to complete a line at once. Because the opponent can only block one square per turn, a fork usually decides the game. Most losses against strong players come from allowing a fork rather than from missing a block.

Is the score saved between visits?

No. The tally of X wins, O wins and draws lasts while the page is open, so you can settle a long match in one sitting. Refreshing the page starts the match over.

Is this Tic Tac Toe game free and private?

Yes. It is completely free with no sign-up, and everything runs in your browser — the computer opponent is calculated on your own device, and nothing is uploaded.

Related tools