Tic-Tac-Toe — Free X and O Game
Three in a row, one smart move at a time
Runs in your browser · nothing is uploaded
Small board. Perfect move.
Nine squares. Two symbols. A little strategy.
Changing mode starts a new game.
Last move: —
The playbook
X starts. Take turns placing X and O in empty squares. The first to connect three horizontally, vertically or diagonally wins. A full board without a winner is a draw.
The computer uses minimax to consider every continuation. With perfect play on both sides, the game ends in a draw.
Tab to the board, use arrow keys to navigate, then Enter or Space to play.
Against the computer, Undo takes back your move and the computer response together.Nine squares, a complete little challenge
Tic-tac-toe, also called noughts and crosses, is a quick game for two sides. Place X and O on a 3×3 board and race to connect three symbols. Play against the built-in computer or challenge someone beside you.
How to play
- Choose Play computer or Two players. Changing the mode starts a fresh board.
- X moves first. Click or tap any empty square, then let O take a turn.
- Make a horizontal, vertical or diagonal line of three to win.
- Use Undo to explore a different move, or New game to start again.
The current side is highlighted above the board. A small dot marks the latest move; a completed winning line turns green. All empty squares are legal moves while the game is in progress.
Rules and an example
A square can hold only one symbol and cannot be changed after placement. Three Xs at the top-left, center and bottom-right form a winning diagonal. If the board fills without any three-in-a-row line, the game ends in a draw.
The computer checks every possible continuation with minimax. It will take a win when available and prevent a loss whenever possible. Against optimal play, aim for a draw by blocking immediate threats and avoiding forks.
Keyboard and privacy
Tab to the board, use arrow keys to select a square, then press Enter or Space. Home and End move to the edges of a row. Game moves run locally in the browser and are not uploaded. The board and undo history reset when you refresh or close the page.
FAQ
Who goes first?
X always goes first. In computer mode, you play X and the computer plays O. In two-player mode, share the same device and alternate turns.
Can I beat the computer?
The computer uses a complete minimax search and chooses an optimal reply. Perfect play from both sides produces a draw; a mistake can let the computer win.
What happens if all nine squares are filled?
If neither player has three in a row, the game is a draw. A winning line on the last move still counts as a win.
What does Undo do?
In two-player mode, Undo removes the last move. Against the computer, it takes back your most recent move and the computer's response together.