Tic Tac Toe: The Classic Game of X and O
Tic Tac Toe is one of the oldest and simplest games ever played. Two players take turns marking squares on a 3 by 3 grid. The first to line up three marks in a row, column, or diagonal wins. If all nine squares fill up with no winner, the game is a draw.
It has been played for thousands of years, with versions found in ancient Egypt and Rome. Today it is a staple of childhood, pencil and paper games, and quick browser breaks.
How to Play
- 2 Players mode: Take turns clicking squares. X goes first, then O.
- Computer mode: Play against the computer. Choose Easy, Normal, or Hard difficulty.
- Keyboard Accessibility: Press 1 through 9 to mark the corresponding square, left to right and top to bottom.
In computer mode, you and the computer alternate who goes first each round. The score board tracks wins for each side plus draws.
The Unbeatable Strategy
Here is something most people do not realize: with perfect play from both sides, Tic Tac Toe always ends in a draw. Neither player can force a win against an opponent who knows the strategy. The game is considered “solved.”
That said, you can still win against someone who makes mistakes. The best opening move is the center square. From there:
- If you take center: Your opponent must play a corner. If they play an edge, you can force a win.
- If you take a corner: The only safe response for your opponent is the center.
- If you take an edge: This is the weakest opening and gives your opponent the advantage.
Example: You play X in the center. Your opponent plays O on an edge square. You can now play a corner that threatens two lines at once, forcing your opponent to block one while you complete the other.
Computer Difficulty Explained
Easy
Picks random empty squares. Makes mistakes and gives you plenty of chances to win.
Normal
Plays well 70% of the time but occasionally makes a random move. Beat it with focused play.
Hard
Plays perfectly. It will win if you make a mistake and draw if you play well. Do not expect to win often.
The Reality
Even on Hard, the computer cannot force a win if you play perfectly. The best you can do against it is draw.
Frequently Asked Questions
Can I always win at Tic Tac Toe?
Against a random player, yes. Against a perfect player, no. Two perfect players will always draw.
Who goes first?
X always goes first. In computer mode, you and the computer alternate who plays X each round.
Are my scores saved?
Scores are kept for the current session only. Refresh the page and they reset to zero.
Can I use the keyboard instead of clicking?
Yes. Press 1 through 9 to mark squares. The layout matches a number pad, with 1 at the top left and 9 at the bottom right.
What is a fork in Tic Tac Toe?
A fork is when you create two possible winning lines at once. Your opponent can only block one, so you win on the next move.
Is this game solved?
Yes. Mathematicians have analyzed every possible game. With perfect play, the result is always a draw.