Play the classic X and O game against a friend or challenge the AI across three difficulty levels. No sign-up required.
Tic-Tac-Toe is one of the oldest strategy games in human history, yet it remains compelling because of the depth hidden in its simple 3Γ3 grid. Every game is a miniature battle of foresight, pattern recognition, and adaptation. A beginner might play randomly, but a skilled player learns to control the center, claim corners, and force opponents into impossible positions. Against Hard AI, the game becomes a test of whether you can match a perfect minimax algorithm β a true mental benchmark.
This browser-based Tic-Tac-Toe game offers three AI difficulty levels and a two-player local mode. Easy mode picks moves randomly. Medium mode blocks your wins and takes its own β a balanced challenge. Hard mode deploys a full minimax algorithm, making it theoretically unbeatable. The score tracker persists across rounds so you can compete in a series. Everything runs locally in your browser with no server calls.
Choose your game mode
Select 'vs AI' to play against the computer or 'vs Friend' to play locally with another person. Switching modes resets the score.
Set the AI difficulty (vs AI mode)
Easy: the AI plays randomly. Medium: the AI blocks threats and takes winning moves. Hard: the AI uses minimax and never makes a mistake.
Pick your symbol
Choose whether you want to play as X or O. X always goes first. If you choose O, the AI makes the first move.
Make your move
Click any empty cell to place your symbol. Get three in a row β horizontally, vertically, or diagonally β to win.
Track the score
The scoreboard shows X wins, draws, and O wins across multiple rounds. Click 'New Game' for a fresh round or 'Reset Score' to clear all scores.
Control the center
The center cell participates in four winning lines β more than any other. Always take it first if available.
Corners beat edges
Corner cells participate in three winning lines each. Edge cells only two. Prioritize corners after the center.
Create a fork
A fork creates two simultaneous threats. Your opponent can only block one β giving you the win on the other.
Block forks immediately
If your opponent can create a fork, block it before it forms. Recognize two-move threats early.
Against Hard AI: play for the draw
The Hard AI is theoretically unbeatable. With perfect play from both sides, every game ends in a draw. Achieving a draw against Hard AI is its own reward.