Tic-Tac-Toe — also known as noughts and crosses — is the three-by-three classic almost everyone learns as a child. You play as X and move first, taking turns with the computer to claim squares on the grid. It is instant to learn, takes seconds to play, and hides surprising strategic depth once you face a sharper opponent.
What makes this version a real test is the AI. On Easy it plays casually and you can outwit it; on Medium it mixes smart and random moves; and on Hard it uses a perfect minimax algorithm that never loses — the very best you can hope for is a draw. A running scoreboard tracks your wins, draws and losses across games. This is free online Tic-Tac-Toe you can play in browser instantly, with no download and no sign-up.
Tic-Tac-Toe is far older than it looks. The Romans played a close relative called terni lapilli, scratching three-by-three grids into stone across the empire, and the pencil-and-paper version was a Victorian schoolroom staple under the name noughts and crosses. It also holds a place in computing history: OXO, a 1952 program written for Cambridge's EDSAC computer, played perfect Tic-Tac-Toe and is a strong candidate for the first graphical video game ever made.
The game is small enough to be completely solved — there are 255,168 possible ways a game can play out — and with perfect play from both sides every single one ends in a draw. That's what makes the Hard AI here interesting: you cannot beat it, only hold it. The classic human edge lies in traps: open in a corner, and if your opponent answers anywhere but the centre, you can engineer a double threat that wins on the spot.
Be the first to place three of your marks in a row — horizontally, vertically or diagonally. If the grid fills with no three-in-a-row, the game is a draw.
Click or tap any empty square to place your X. The AI responds automatically. Click Play again after each game to start a new round.
Each game is recorded on the scoreboard as a win, draw or loss. Difficulty sets the AI: Easy plays random moves, Medium mixes smart and random, and Hard is a flawless, unbeatable minimax opponent.
Take the centre when you can — it sits on the most winning lines. Watch for the AI's two-in-a-row and block it, and create a "fork" (two threats at once) so it can't stop both. Against the Hard AI, perfect play only earns a draw, so focus on never giving it an opening.
Can the Hard AI ever be beaten?
No — it plays a perfect minimax strategy, so the best possible result against it is a draw. Managing a draw every game means you're playing perfectly too.
What's the best first move?
The centre is the safest opening, joining four possible lines. A corner opening is the trickiest, creating the most opportunities to set a double-threat trap.
Why does Tic-Tac-Toe always end in a draw between good players?
The game is fully solved: with only 9 squares and 8 winning lines, a careful player can always block every threat, so perfect play from both sides guarantees a tie.
More classic games: Four in a Row, Gomoku, Dots and Boxes, Nine Men's Morris, Sim, and all 100 free games.