Play Tic-Tac-Toe Online
Play Tic-Tac-Toe in your browser—no download, no sign-up. You play as X against the computer (O). Click an empty cell to place your mark; the computer responds automatically. Choose Easy, Medium, or Hard and see how you do.
What is Tic-Tac-Toe?
Tic-Tac-Toe is a classic two-player game on a 3×3 grid. Players take turns placing their mark (X or O) in an empty cell. The first to get three in a row—horizontally, vertically, or diagonally—wins. If the grid fills with no winner, the game is a draw.
How to Play
- You are X and always move first. The computer is O.
- Click an empty cell to place your X. The board will show "Computer thinking..." for a moment, then the computer places O.
- Alternate turns until one player has three in a row or the board is full.
- Win by getting three X's in a row (horizontal, vertical, or diagonal). The winning line is highlighted.
- Draw when all nine cells are filled and no one has three in a row.
- Use Restart to start a new game. You can change Difficulty before or during a game; the new level applies from the next computer move.
Rules Summary
- Board: 3×3 grid; 9 cells.
- Players: You (X) vs computer (O). You go first.
- Move: Click an empty cell to place your mark.
- Win: First to get three in a row (any line). Winning line is highlighted.
- Draw: All cells filled with no winner.
Difficulty Levels
- Easy – The computer usually plays a random move. It has a 30% chance to block you when you're one move from winning. Good for learning and casual play.
- Medium – The computer sometimes plays randomly (15%) but often uses a limited look-ahead (minimax with depth 3). It can miss fork opportunities. A fair challenge.
- Hard – The computer uses full minimax and always plays the best move. It never loses; with perfect play from both sides, the game is a draw.
Strategy Tips
- Center – Taking the center (middle cell) gives you the most options.
- Corners – Corners are strong; they appear in multiple winning lines.
- Forks – Try to create two ways to win at once so the computer can't block both.
- Block – If the computer has two in a row, block the third cell.
- Hard mode – With optimal play, the best you can do is a draw. Focus on not making a mistake that gives the computer a win.
Why Play Tic-Tac-Toe Online?
Playing in the browser is free and works on any device. You don't need an account—just open the page and play. You always have an opponent (the computer), and you can restart or change difficulty anytime. Great for a quick game or for learning how an unbeatable AI thinks.