Tic Tac Toe

Tic tac toe is a two-player game on a 3 × 3 grid: X and O take turns marking an empty square, and the first player with three of their own marks in a line — across, down or diagonally — wins. There are 255,168 possible games, but correct play by both sides always ends in a draw, so the only way to win is for your opponent to make a mistake.

Your move
TurnXMarks0Time0:00LevelSharpGame#0

New game clears the board and lets whoever plays X start. Take back lifts your last mark and the computer’s reply together, and Hint names the strongest square and says why it is strongest. The three-dot menu at the end of the bar holds the board size, the level, a two-player game on one device, and whether you play X or O.

Your statistics · 3 × 3 · Sharp

Played
0
Won
0
Win rate
0%
Streak
0
Best streak
0
Best time
—

This level

It never misses a win and never leaves a threat unblocked, but it only answers the mark you just played. One mark that makes two threats at once is more than it can block.

Keyboard

Arrows
Move between squares
Enter / Space
Play a mark
U
Take back
H
Hint
N
New game
F
Full screen
Grid
3 × 3, 4 × 4 or 5 × 5
Players
One or two
Possible games
255,168
Perfect play
Always a draw

What are the rules of tic tac toe?

  • The board is a 3 × 3 grid of nine empty squares.
  • X always goes first, then the players alternate. Nobody may pass a turn.
  • A turn writes one mark on one empty square. Marks are never moved or erased.
  • Three of your own marks in a straight line — a row, a column, or either diagonal — wins immediately.
  • If all nine squares are filled with no line, the game is a draw.

There are exactly eight ways to make a line: three rows, three columns and two diagonals. That number is the whole geometry of the game, and it is why the centre square matters — the centre sits on four of those eight lines, a corner on three, and an edge square on only two.

Why does tic tac toe always end in a draw?

Because the game is small enough to solve completely, and the solution is a draw. Counting every distinct sequence of moves, there are 255,168 possible games, played out across 5,478 reachable positions and ending on one of 958 distinct final boards — 138 of them once rotations and reflections are folded together. A computer can search all of it in a few milliseconds, which is why the Perfect level cannot be beaten on this board: it is not guessing well, it is reading the end of every line. On the two bigger boards below the same level searches deep rather than to the end, and there it can be beaten.

How the 255,168 possible games end
ResultGamesShare
X wins131,18451.4%
O wins77,90430.5%
Draw46,08018.1%

Those are counts of move sequences, not of likely outcomes — they weight a game in which O throws away the centre exactly as heavily as a game between two careful players. They do show the shape of the advantage, though: moving first is worth a great deal when your opponent is careless, and worth nothing at all when they are not.

What is the best first move in tic tac toe?

Against a perfect opponent, none of them is better: all nine openings draw. Against a fallible one the centre and the corners are far more dangerous than an edge, because of how narrow they leave the reply. The table below is measured from the search on this page, not from folklore — it is the number of O's replies that still hold the draw.

How many of O's eight replies survive each opening
X opens onReplies that drawReplies that lose
A corner1 — the centre only7
The centre4 — the four corners4
An edge4 — centre, the two corners of that edge, the opposite edge4

So the corner is the sharpest opening in practice: it leaves your opponent exactly one saving square out of eight, and taking any of the other seven hands you a forced win. The centre looks strongest and is the safest reply, but as an opening it leaves four ways out rather than one.

How do you actually win at tic tac toe?

With a fork: one mark that creates two winning squares at the same time. Your opponent has one turn and can block only one of them, so the other wins. Every win in this game against anyone who is paying attention is a fork, and the shortest one runs like this — open in a corner; if O answers on an edge, take the centre. You now hold two of the three squares on the long diagonal, so O must block the far corner, and your third mark on a free corner makes two lines-in-waiting at once.

The two corner replies need one adjustment each, and knowing which is the difference between a line you can run and a line you half-remember. If O answers on a corner beside yours, the centre still forces the same block — but the square that forks is then an edge, not a corner. If O answers in the corner opposite yours, the centre threatens nothing at all, because O is already sitting on that diagonal; take one of the two free corners instead, which threatens the side you share, and the fork arrives one mark later.

The defence is the mirror image. Answer every immediate threat, but before you do, check whether the square you were about to take lets your opponent fork next turn. That look-one-move-further is exactly the difference between the Sharp level here and the Perfect one — see how to play tic tac toe for the full worked line.

Is there a version of tic tac toe that is not a draw?

The 3 × 3 game is thin on its own once both players know it, so this page also offers two bigger boards where four in a row wins. They are genuinely different games rather than the same one stretched, because the number of ways to make a line changes completely.

The three boards
BoardSquaresTo winWinning lines
3 × 393 in a row8
4 × 4164 in a row10
5 × 5254 in a row28

The 4 × 4 board is tighter than it looks: sixteen squares but only ten lines, because a four-in-a-row there has to fill a whole row, a whole column or a full diagonal. The 5 × 5 board is the opposite — a run of four can start anywhere along a line, which gives 28 of them and makes double threats routine. Neither board is small enough to solve outright, so on those two the Perfect level searches as deeply as a browser tab allows and plays the last squares exactly. That is strong, but it is not a proof, and it can be beaten.

How do you get better at tic tac toe?

  • Take the centre when it is freeThe centre square lies on four of the eight winning lines; a corner lies on three and an edge on only two. That is not a rule of thumb, it is the geometry of the board — and it is why, after a centre opening, all four edge replies lose to correct play while the four corner replies hold the draw.
  • Open in a corner against a humanA corner opening leaves your opponent exactly one saving reply out of eight — the centre. Any of the other seven hands you a forced win. The centre opening is safer but leaves four ways out, so against a real person the corner is the sharper practical try.
  • Play for two threats, not oneA single three-in-a-row threat is blocked by one mark, so it wins nothing against anyone who is looking. Aim instead for a mark that completes two lines-in-waiting at once: your opponent has one turn and two holes to plug, and that is the only way any game here is ever won.
  • Check the square you are about to blockAnswering an immediate threat is the easy half. Before you place the block, ask whether it hands your opponent a fork next turn — losing while dutifully blocking is the commonest way a competent player loses, and it is exactly what separates the Sharp level here from the Perfect one.
  • On the bigger boards, count the open linesOn the 5 × 5 board a run of four can start anywhere, so there are 28 lines rather than 8 and a single mark can sit on eight of them. Play where your marks share the most uncontested lines, and remember that a line with one of each mark in it is worth nothing to anybody and can safely be ignored.

Tic Tac Toe questions people ask

Can you always win at tic tac toe?
No. Against an opponent who plays correctly the best result available is a draw. You can always avoid losing, though — a player who never misses a win, never leaves a threat unblocked, and never allows a fork cannot be beaten.
Who wins tic tac toe if both players play perfectly?
Nobody. The game is a proven draw. The Perfect level on this page searches every game that can still be played from the position in front of it, and the test suite walks every possible opening to confirm it never loses one.
Is it better to go first in tic tac toe?
Only against a fallible opponent. Of the 255,168 possible games, 131,184 are won by X and 77,904 by O — but that advantage vanishes entirely against correct play, where every opening draws.
What is a fork in tic tac toe?
A single mark that creates two winning squares at once. Your opponent gets one turn and can only block one of them, so the other completes a line. It is the only way to beat someone who blocks every threat you make.
Can I play tic tac toe against a friend on one device?
Yes. Choose Two players in the three-dot menu and the board simply waits for whoever is on turn, with no computer opponent involved. Those games are deliberately kept out of your win rate, since both results belong to the same device.
Does this tic tac toe work offline?
Yes. The whole game — board, rules and the opponent's search — runs in your browser, so once the page has loaded it needs no connection, no account and no download.

The rules in six lines

  1. 1Set up the gridDraw a 3 × 3 grid of nine empty squares. One player takes X, the other takes O.
  2. 2X startsX always plays the first mark. After that the players alternate, and neither may skip a turn.
  3. 3Mark one empty squareA turn consists of writing your own mark in any one square that is still empty. Marks are never moved, erased or replaced.
  4. 4Make three in a rowThree of your own marks in a straight unbroken line wins at once — any of the three rows, the three columns, or the two diagonals.
  5. 5The game stops at the winning markAs soon as a line is complete the game ends, whether or not there are empty squares left on the board.
  6. 6A full grid is a drawIf all nine squares are filled and no line has been made, the game is drawn. Neither player scores, and correct play always leads here.

The long version, with worked examples and the questions beginners actually ask, is on how to play tic tac toe.

Put Tic Tac Toe on your own site

The board runs in an iframe with no tracking, no cookies and no sign-up. Paste this wherever you want it. See all the embeddable games for the rest.

<iframe src="https://www.cardgamenook.com/embed/tic-tac-toe" width="100%" height="620" style="border:0;border-radius:10px;max-width:900px" title="Tic Tac Toe — free online" loading="lazy"></iframe>
<p style="font:14px system-ui;margin:6px 0 0"><a href="https://www.cardgamenook.com/tic-tac-toe">Play Tic Tac Toe</a> at Card Game Nook</p>