← Back to all games
❌⭕

Tic-Tac-Toe

Classic

Outsmart the computer in three-in-a-row, the classic way.

You (X): 0Computer (O): 0Ties: 0

Your move — click a square.

How to play

You play X, the computer plays O. Take turns clicking empty squares — the first to line up three in a row, column, or diagonal wins.

About Tic-Tac-Toe

Tic-tac-toe is very likely the first strategy game most people ever learn, often taught with nothing more than a pencil and the corner of a notebook page long before anyone explains formal rules of strategy at all. Three rows, three columns, two symbols, and a simple win condition: line up three of your own symbol in a row, column, or diagonal before your opponent does. It's also, less obviously, a genuinely useful introduction to a concept that shows up throughout mathematics and computer science — that a game can be small enough to fully solve, where perfect play from both sides always ends the same way.

A game that's been fully solved

Unlike chess or most other strategy games, tic-tac-toe has a known, complete solution: if both players always make the best available move, every single game ends in a tie. This has been true since long before computers existed to confirm it, and it's part of why the game is such a common first example in early computer science and game theory education — it's small enough that a person can map out every possible sequence of moves by hand, and yet the resulting strategy still has genuine depth to discover through play rather than memorization alone.

How to play this version

You always play as X and move first. Click any empty square to place your mark, and the computer responds with an O immediately afterward. The first player to line up three matching symbols horizontally, vertically, or diagonally wins the round; if all nine squares fill without a winner, it's recorded as a tie. The scoreboard above the board tracks your wins, the computer's wins, and ties across as many rounds as you want to play, so you can watch your ratio improve as you get more familiar with the opponent's patterns.

How the computer opponent thinks

The computer here isn't playing randomly. On each turn it first checks whether it can win immediately, and takes that win if available. If it can't win this turn, it checks whether you're one move away from winning and blocks that square instead. Failing either of those, it prioritizes the center square if open, since the center participates in more possible winning lines than any other square, and falls back to a corner over an edge, since corners also touch more potential winning lines than edge squares do. This mirrors the same priority order that experienced human players learn intuitively, which is exactly why tic-tac-toe against a competent opponent so reliably ends in a tie once both sides know what they're doing.

Strategy that actually works

If you move first, taking the center square gives you the strongest possible opening, since it's involved in four different potential winning lines compared to three for a corner and only two for an edge square. If the center is already taken, a corner is the next best choice. Beyond the opening, the single most important habit is checking for your opponent's near-wins before making your own move — a fork, where your opponent creates two separate winning threats at once, is nearly impossible to block if you don't notice it a move in advance. Watch specifically for any move that would give your opponent two different three-in-a-row opportunities simultaneously; that's the pattern that beats otherwise-careful players most often.

Why a "solved" game is still worth playing

Knowing that perfect play always ties doesn't make the game pointless — it makes it a genuinely good way to practice a specific mental skill: looking one or two moves ahead and recognizing threats before they fully materialize. That skill transfers directly to other strategy games with much larger, unsolved decision spaces, which is part of why tic-tac-toe so often shows up as an early teaching tool rather than being dismissed as too simple. Every round here is also a fresh test of whether you can force a tie against an opponent that's actively trying to punish any slip.

Play another round

Click "New round" any time to reset the board while keeping your running score intact. If you enjoy short, sharp strategy formats like this, Rock Paper Scissors in the classic category offers a different kind of quick decision-making, built around probability rather than positional logic.