tictactoe.net
  1. Play
  2. Guides
  3. Is it solved?

The numbers

Is tic tac toe solved? All 255,168 games, counted

By TicTacToe.net · Updated 15 October 2026 · 6 min read

Yes. Tic tac toe is a solved game: if both players make no mistakes, it always ends in a draw. To show exactly how that works, we had our game engine play out every possible game of tic tac toe — all 255,168 of them.

Key facts

What “solved” means

A game is solved when we know the result with perfect play. Tic tac toe is strongly solved, the strongest kind: for every one of its positions, we know the best move and the outcome. That's possible because the game is tiny. A computer can simply try everything — the technique is called minimax: assume your opponent always picks the move that's worst for you, and pick the move whose worst case is best.

Run minimax from the empty board and every first move comes back as a draw. Our Hard bot does exactly this search on 3×3 before each move, which is why it can't lose.

Every game of tic tac toe

Counting each different sequence of moves that ends in a win or a full board, there are 255,168 possible games. Here's how they break down by length:

Game lengthX winsO winsDrawsTotal
5 moves1,440——1,440
6 moves—5,328—5,328
7 moves47,952——47,952
8 moves—72,576—72,576
9 moves81,792—46,080127,872
All games131,18477,90446,080255,168

X can only win on its own turn — the 5th, 7th or 9th move — and O on the 6th or 8th, which is why each row has a single winner. The quickest possible win takes five moves: three for X, two for O.

Those games pass through 5,478 distinct positions (counting the empty board), and finish in one of 958 distinct final boards. Many sources quote smaller numbers, like 138 final boards: that's the count after treating rotations and mirror images of the board as the same.

So why do so few games end in a draw?

Only 18.1% of possible games are draws, even though perfect play always draws. The game tree is mostly mistakes: most of those 255,168 games contain at least one move a good player would never make. Play the moves at random and the first player cleans up:

If both players move at random…Chance
X (first player) wins58.5%
O (second player) wins28.8%
Draw12.7%

That gap is the whole reason strategy matters. A careful player turns a coin flip into a guaranteed draw — and wins whenever the other side slips. Our guide on how to win at tic tac toe shows the openings and traps.

What about bigger boards?

Mathematicians study tic tac toe's big siblings as m,n,k-games: an m×n board where you need k in a row. Results for the boards you can play here:

BoardTo winPerfect play
3×33 in a rowDraw
4×44 in a rowDraw
5×54 in a rowDraw
6×64 in a rowFirst player wins

The 6×6 result follows from the fact that four in a row on a 6×5 board is already a first-player win — more room can only help the first player (source: the m,n,k-game results). But knowing that a winning strategy exists isn't the same as knowing it. Nobody plays 6×6 perfectly from memory, and our own bot only looks a limited number of moves ahead on boards that size, so in practice those games are wide open.

A different kind of solved: infinite tic tac toe

In infinite tic tac toe, each player can only keep three marks, and your oldest one vanishes when you place a fourth. The board never fills, so the draw argument disappears. We solved that version too, by working backwards through all 116,074 of its positions. The result is the opposite of the classic game: the first player wins. The details — including the surprising best first move — are in our infinite tic tac toe guide.

Tic tac toe and the first computers

Because it's small enough to solve, tic tac toe was one of the first games given to machines. In 1952, Sandy Douglas wrote OXO for Cambridge University's EDSAC computer, showing the board on a tiny screen — one of the earliest graphical computer games. In 1961, Donald Michie built MENACE, a “computer” made of around 300 matchboxes full of coloured beads, which learned to play better by adding beads for good moves and removing them for bad ones.

Think you can hold a draw against perfect play?

Play the Hard bot

Questions people ask

Is tic tac toe a solved game?

Yes. Tic tac toe is strongly solved: the best move is known from every possible position. If both players play perfectly, the game always ends in a draw.

How many possible games of tic tac toe are there?

255,168, counting every distinct sequence of moves that ends in a win or a full board. X wins 131,184 of them, O wins 77,904, and 46,080 are draws.

How many tic tac toe positions are there?

5,478 different board positions can occur in a legal game, including the empty board. 958 of them are finished games.

Is 4x4 tic tac toe solved?

Yes. On a 4×4 board where you need four in a row, perfect play is a draw. On 5×5 with four in a row it is also a draw, but on 6×6 with four in a row the first player can force a win.

Keep reading