Tic-Tac-Toe

You are X. Beat the computer — or draw against it.

XOXOXO
You (X)0
Draws0
CPU (O)0
Your move — click a square.

What this game is

Tic-tac-toe is the two-player classic on a 3×3 grid: line up three Xs in a row — horizontally, vertically or diagonally — before the computer lines up three Os. You always play first. The running score tracks your wins, draws and losses across games.

The interesting part is the difficulty switch. Easy makes occasional mistakes, Normal plays solidly but not perfectly, and Hard uses the minimax algorithm — it looks ahead through every possible game and literally cannot lose. Playing hard mode repeatedly is a lesson in why perfect play draws.

How to play

  1. Pick a difficulty, then click any square to place your X.
  2. The computer answers instantly with its O.
  3. Get three in a row to win — the winning line lights up green.
  4. Press New game to start the next round. The score keeps running until you reset it.

Why Hard mode always draws

minimax: assume the opponent plays the best reply to every move search the full game tree (only 255,168 possible games) pick the move with the best worst-case outcome

Tic-tac-toe is a solved game: with optimal play from both sides it always ends in a draw. That means on Hard mode, your best possible result is a draw — and a draw is a genuine achievement. Most people lose their first few games because they miss a fork: two simultaneous threats that the computer can only block one of.

Strategy tips

Frequently asked questions

Can I beat Hard mode?

No — and that is the point. It plays the minimax algorithm perfectly, so a draw is the ceiling. If you ever win, that would be a bug worth reporting through the contact page.

Does the score persist?

The running score lives in the page, so it resets when you reload. The game is completely offline and private — no accounts, no uploads.

What should I try next?

If you want more brain games, Mental Math Sprint, Number Sequences or the full games list.

Related calculators

Game night is over — back to real numbers: the Arithmetic Calculator, Percentage Calculator and Age Calculator are always one click away.