Board Games
Tic Tac Toe - Play Online
Challenge an unbeatable local AI with hints, exact undo, side choice, keyboard play, and pointer drag controls.
Your turn (X)
Choose any of 9 empty squares.
Next mark
Click to select, or drag onto an empty square.Checking every legal game path...
Rules, controls, and winning ideas
How the round works
X always goes first. You and the computer alternate placing one mark in an empty square. The first horizontal, vertical, or diagonal line of three wins. A full board without a line is a draw. Match scores count completed rounds.
Play, undo, and keyboard
- Click or tap an empty square, or click the next mark and then a square.
- Drag the next mark onto a square with mouse, touch, or pen. Releasing elsewhere cancels safely.
- On the board, use Arrow keys, Home, or End to move. Press Enter or Space to play.
- H gives a legal hint, U undoes your last decision, N starts a new game, and R restarts.
- Undo removes your move and the computer reply together. Restart replays the round and rolls back its result. New game keeps the match score.
- Escape first cancels a drag or selected mark.
Meet the perfect opponent
The local AI searches every remaining finish with minimax. It takes a win, protects a draw, and never loses on this 3 by 3 board. Equal moves use a fixed center, corner, then edge order, so identical positions get identical replies. Look for an immediate win, block a threat, then build or stop a fork.
Game state stays in this page and is not saved. The game code uses no account, remote opponent, external asset, or network request.