Tic Tac Toe

Classic strategy game — get three in a row to win!

Mode:
AI:

Your turn (X)

Wins: 0 Losses: 0 Draws: 0 Streak: 0 Best Streak: 0

About Tic Tac Toe

Tic Tac Toe, also known as Noughts and Crosses or Xs and Os, is one of the oldest and most beloved strategy games in the world. Played on a 3×3 grid, two players take turns marking spaces with X and O. The first player to get three marks in a row—horizontally, vertically, or diagonally—wins the game. If all nine squares are filled without a winner, the game ends in a draw.

How to Play

To play Tic Tac Toe, simply click an empty cell on the grid to place your mark. In Player vs AI mode, you play as X and always go first. The AI plays as O and responds based on the difficulty you select. In 2-Player mode, players alternate turns—one plays X, the other O. The game automatically detects when someone wins or when the board is full (a draw). Click "New Game" at any time to start over. Your session statistics—wins, losses, draws, and streaks—are tracked and saved locally.

Strategy Tips

Although Tic Tac Toe is solved (meaning optimal play always leads to a draw), strategy still matters against human opponents or lower-difficulty AI. The center square is the most powerful position—taking it gives you the most winning combinations. Corners are stronger than edges. If your opponent takes the center, occupy a corner to avoid losing. When you have two in a row, always complete the line to win. When your opponent has two in a row, block them immediately. In 2-player games, forcing your opponent into a "fork" (two ways to win on your next move) is a winning tactic.

History

Tic Tac Toe has ancient roots. Evidence of similar games dates back to ancient Egypt around 1300 BCE. The Roman Empire had a game called "Terni Lapilli" played on grids. The modern name "Tic Tac Toe" appeared in the late 19th century, possibly derived from "tick-tack," an older name for backgammon. The game became a staple of pencil-and-paper play and was one of the first games programmed for early computers. In 1952, OXO (or Noughts and Crosses) for the EDSAC computer was one of the first video games ever created. Today, Tic Tac Toe remains a perfect introduction to game theory and combinatorial game theory.

FAQ

Can you beat the Hard AI?

No. The Hard AI uses the minimax algorithm, which evaluates all possible moves and plays optimally. With perfect play from both sides, Tic Tac Toe always ends in a draw. The Hard AI will never lose and will win if you make a mistake.

What's the difference between Easy and Normal AI?

Easy AI chooses moves randomly from available squares. Normal AI blocks your winning moves and will take a win if it sees one, but doesn't look ahead further. It can be beaten with basic strategy.

Is there a winning strategy?

Yes. If you go first, take the center. If your opponent takes the center, take a corner. With optimal play from both players, the game always ends in a draw. The key is to never miss a block or a winning move.

How is the streak calculated?

Your streak increases with each win and resets to zero after a loss or draw. Your best streak is the highest streak you've achieved in this session and is saved in your browser.