Tic-tac-toe, solved. Every one of its 5,478 positions, evaluated exactly.

X to move. Draw with best play.

Click a square or press 1 to 9. The solver answers as O.

Every move, evaluated

Best play from here

Games that can still be played

The solver works through the complete game tree: 255,168 distinct games, 5,478 legal positions, 958 of them finished. Each position is scored for the side to move as a win, a draw, or a loss, with the number of moves to the end under best play; wins are taken as fast as possible and losses put off as long as possible. When several moves are equally good, the solver prefers the sharpest one, the move that leaves the opponent the fewest replies that keep their result, which is why it opens in a corner rather than the center: after a corner, only the center holds the draw.

Reasons for moves follow the order of Newell and Simon's 1972 program: win, block, fork, block a fork, center, opposite corner, empty corner, empty side. Everything runs in this single file.