Game Data

The Best First Move in Tic-Tac-Toe, and Why You Still Can’t Win

By Lucian — builder & engineer, LK Forge

Tic-tac-toe is small enough to solve completely, so we did: we walked all 255,168 games and counted every outcome. Two things fall out. Between two perfect players it is a forced draw — nobody can ever win, which is exactly why you can’t beat the computer. But the moment play is imperfect the game is lopsided: the first player wins 51% of all games, and the strongest opening isn’t the corner most people reach for — it’s the center.

 ·  5 min read  ·  exact, from a full game-tree enumeration  ·  Updated September 2026

255,168
distinct games of tic-tac-toe
Draw
the result whenever both sides play perfectly
51%
of all games won by the first player
Center
the strongest opening — on 4 of 8 winning lines

How we counted it

These are not estimates. Tic-tac-toe has so few positions that a computer can walk the entire game tree — every legal sequence of moves, from the empty board to a win or a full grid — in a fraction of a second. So instead of playing a sample of games we enumerated all of them, stopping each line the moment a player made three in a row (as the game actually ends), and tallied who won.

The total comes out to 255,168 games — 131,184 first-player wins, 77,904 second-player wins, 46,080 draws. That figure is the long-published census of the solved game, so reproducing it exactly is our proof that the enumeration is right rather than subtly miscounting. Everything else here — the opening-square splits, the random-vs-random outcome, the forced-draw result under optimal play — comes from the same exhaustive walk.

Going first is a real edge

On a nine-square board the first player places five of the marks to the opponent’s four, always reaching new threats a move ahead. Over every possible game that shows up as a 1.7-to-1 win ratio in the first player’s favour — and if both sides just move at random, it barely changes, with draws collapsing to one game in eight.

0% 17.5% 35% 52.5% 70% 51.4 58.5 First player (X) wins 30.5 28.8 Second player (O) wins 18.1 12.7 Draw lkforge.com

Outcome share across all 255,168 games (solid) and for two random players (faded). The first player leads in both; draws are the minority outcome unless play is skilled.

Why the center is the strongest opening

Each square belongs to a different number of winning lines. The center is on four — its row, its column and both diagonals; a corner is on three; an edge on only two. More lines through your first mark means more ways to make a threat, and the win counts follow exactly: games opened in the center are first-player wins 60.5% of the time, a corner 52.8%, an edge just 48.1%.

0% 35% 70% 60.5% 4 winning lines Center 52.8% 3 winning lines Corner 48.1% 2 winning lines Edge X win lkforge.com

First-player win share by opening square, over all games from that opening. The center leads because it touches the most winning lines. (A corner is the sharper trap against certain experienced opponents — but by raw win count, the center is strongest.)

Every number

Games countedCountFirst playerSecond playerDraw
All games 255,168 131,184 · 51.4% 77,904 · 30.5% 46,080 · 18.1%
Open on center 4 lines 60.5%
Open on corner 3 lines 52.8%
Open on edge 2 lines 48.1%
Two random players weighted 58.5% 28.8% 12.7%
Both play perfectly 0% 0% 100% (forced draw)

Exact counts from a full game-tree enumeration, 10 September 2026. Games are counted as move-orders; opening rows give the first player’s win share among all games from that opening.

So how do you never lose?

The census says the game is won and lost on mistakes, so avoiding your own is the whole job. Two rules cover almost all of it: always take a winning move if you have one, and always block your opponent’s three-in-a-row threat if they have one. The rest is about forks — positions with two threats at once, which cannot both be blocked. Open in the center or a corner, watch for a move that makes two threats, and deny your opponent theirs, and you will draw every game you don’t win.

That is precisely the strategy the LK Forge Tic-Tac-Toe AI follows — it searches the same game tree we enumerated here and picks a move that can never lead to a loss. Which is why the honest answer to “how do I beat the computer?” is: you don’t. You play for the draw, and hope it’s you who moves first against a human. If you want the algorithm itself, watch it think in the minimax explainer.

Reproduce it yourself

The whole census is a dozen lines of dependency-free code — walk every move, count the leaves. If it prints 131184 77904 46080, you have reproduced the solved game.

const LINES = [[0,1,2],[3,4,5],[6,7,8],[0,3,6],[1,4,7],[2,5,8],[0,4,8],[2,4,6]];
const win = b => LINES.some(([a,c,d]) => b[a] && b[a]===b[c] && b[a]===b[d])
  ? b[LINES.find(([a,c,d]) => b[a] && b[a]===b[c] && b[a]===b[d])[0]] : null;

const tally = { X: 0, O: 0, D: 0 };
function walk(b, player) {
  const w = win(b);
  if (w) { tally[w]++; return; }
  const empty = [...b.keys()].filter(i => !b[i]);
  if (!empty.length) { tally.D++; return; }         // full board = draw
  for (const i of empty) { b[i] = player; walk(b, player === 'X' ? 'O' : 'X'); b[i] = 0; }
}
walk(Array(9).fill(0), 'X');
console.log(tally.X, tally.O, tally.D);  // 131184 77904 46080

Tag each game by its first move to get the opening-square splits, or plug in a minimax player to confirm the forced draw. Then go lose to the tic-tac-toe engine yourself.

Try to beat the draw

Play the unbeatable engine free in your browser — open in the center, hunt for a fork, and see how far you get.

Play Tic-Tac-Toe vs the AI →
Share this X Facebook Reddit

Related reading

Common questions

What is the best first move in tic-tac-toe?

The center. It sits on four of the eight winning lines — the row, the column and both diagonals — more than any other square (a corner is on three, an edge on two). Across all 255,168 possible games, the ones that open in the center are won by the first player 60.5% of the time, versus 52.8% for a corner opening and just 48.1% for an edge. There is a well-known argument that a corner is the sharpest opening against a specific kind of experienced-but-imperfect opponent, because it invites a losing reply that sets up a double-threat fork; but by the raw count of where the wins are, the center is the strongest square.

Is tic-tac-toe always a draw?

Only when both players play perfectly. Tic-tac-toe is a solved game whose game-theoretic value is a draw: with optimal play from both sides, neither can force a win, so it ends tied every time. That is not what happens among people, though — perfect play is rare. Across every possible game the first player wins 51.4%, the second player 30.5%, and only 18.1% are drawn. The "it always ties" experience comes from opponents who have both learned the handful of defensive rules, not from the game being drawish by nature.

Does going first give you an advantage?

A large one. Counting all 255,168 games, the first player (X) wins 131,184 and the second player (O) only 77,904 — a 1.7-to-1 edge. If both sides simply move at random the gap is similar: X wins 58.5% of the time, O 28.8%, and the game is drawn just 12.7%. The advantage comes from moving first on an odd, nine-square board: X places the 1st, 3rd, 5th, 7th and 9th marks, so it reaches three-in-a-row threats a tempo ahead.

Can the computer ever lose at tic-tac-toe?

No. A minimax player evaluates the whole game tree and always chooses a move that cannot lead to a loss, so its worst-case result is a draw — it never loses, only wins or ties. That is exactly how the LK Forge Tic-Tac-Toe AI plays, which is why you cannot beat it; the best you can do against optimal play is force the draw the game theory guarantees.

How many possible games of tic-tac-toe are there?

Counting every distinct sequence of moves, with games stopping the moment someone makes three in a row, there are exactly 255,168 games: 131,184 first-player wins, 77,904 second-player wins and 46,080 draws. (That counts games as move-orders; if you instead count only the distinct board positions, or fold away rotations and reflections, the numbers are far smaller — but 255,168 is the classic figure for total games.)

How were these numbers computed?

By exhaustively enumerating the entire tic-tac-toe game tree — not by sampling. The board is small enough that a computer can walk every legal line of play in a fraction of a second, so each figure here is exact. The total, 255,168 games split 131,184 / 77,904 / 46,080, reproduces the long-published solved-game census, which is our check that the enumeration is correct.