Tic-Tac-Toe: play free against the computer or a friend
The board above is the game. There is nothing to download, no account to make, and no ads sitting between you and the first move. Pick an opponent, tap a square, go.
You get three computer opponents and a two-player mode. Easy will let you win. Medium will make you work for it. Unbeatable does exactly what the name promises, and the section further down explains why that is a fact about the code rather than a marketing claim.
How to play Tic-Tac-Toe
- You are X, and X moves first. Tap or click any empty square to place your mark.
- The computer answers as O. How well it answers depends on the difficulty you picked.
- Get three of your marks in a line, across, down, or corner to corner, and the round is yours.
- Fill all nine squares with nobody making a line and it is a draw. Expect a lot of those once both sides know what they are doing.
- Switch to Two players and the computer sits out. Same board, two humans, one device.
Easy, Medium, Unbeatable: which one to pick
Difficulty here is not a search-depth cap. The engine always works out the best move; what changes is how often it is allowed to play something else. Easy takes the best move about a third of the time, so it still blocks you now and then instead of feeling broken, but it leaves plenty of lines open. That is the level to hand a child who has just learned the rules.
Medium plays the best move three times in four. It will take the centre, it will block you, it will build a threat of its own, and then somewhere around move five it will quietly hand you something. Most people should sit here. Beating Medium requires attention rather than luck, which is the whole point of a difficulty setting.
Unbeatable never plays a second-best move. It also breaks ties at random rather than always picking the first best square, so it does not open in the same corner every single game the way a naive perfect engine does. And it prefers to win in two moves over winning in four, which is why it finishes you off instead of appearing to toy with you.
If you want a target to aim at: hold the draw against Unbeatable while playing second. Going first and drawing is not hard once you know the openings. Going second and drawing means you did not make a single mistake.
Two players, one phone
Flip the mode toggle and the computer stops taking turns. X and O are both human from that point, passing the same phone, tablet or laptop back and forth. It is the version you played on the back of a receipt as a kid, without the receipt.
Rounds played this way are scored on their own. An afternoon of games against a friend will not touch the record you have built up against the computer, and either scoreboard can be reset without clearing the other.
Two questions to ask before every move
Nearly every loss on this board comes from the same place. Someone fills a square that looks reasonable without checking what the board actually says first. So: can I win this turn? Then, do I have to block this turn? In that order, every time. That single habit will save you more games than any opening you could memorise.
The short version of the theory: corners are worth more than edges, because three winning lines run through a corner and only two run through an edge. And games between people who both know the rules are almost always decided by a fork, one move that sets up two winning lines at once so the block can only stop one of them.
That is as far as this page goes. The openings that hold, the replies that lose, and a worked fork you can play out square by square are in the strategy guide below.
Why Unbeatable cannot be beaten
Tic-tac-toe is small. The entire game tree is under 550,000 positions before any pruning at all, which means a browser can hold the whole thing and still answer in well under a millisecond. There is no reason to guess at a good move when you can simply look.
So that is what the engine does. On its turn it plays every continuation out to the end of the game, scores each ending as a win, a draw or a loss, and takes the best one available. It is not estimating. It is reading the answer. Since correct play from both sides ends in a draw, the engine cannot lose: if you drop a point, it was your move that dropped it.
This is also why the game runs on the main thread rather than in a worker. A solved 3x3 board comes back instantly. The moment a game on this site needs a real search, that one gets a worker.
Playing without a mouse
The board is a real ARIA grid, not a pile of clickable divs. Tab to it once, move around with the arrow keys, and place your mark with Enter or Space. Every square reports its position and its contents to a screen reader.
Whose turn it is, and how a round ended, go out through a polite live region rather than only changing on screen, so nothing gets announced over the top of you mid-move. If your system asks for reduced motion, the animations are skipped and the game plays exactly the same.
Tic-Tac-Toe: frequently asked questions
Can you actually beat Unbeatable?
No, and that is arithmetic rather than difficulty tuning. The engine solves the position before every move it makes, so the best result available to you is a draw. If you want an opponent you can beat, Easy and Medium both play a weaker move some of the time on purpose.
Which difficulty should I start on?
Medium, unless you are teaching somebody the rules, in which case Easy. Medium plays properly most of the time and slips occasionally, so a win feels earned without being out of reach. Move up when you stop losing.
Does Unbeatable open the same way every game?
No. When several moves are equally good it picks between them at random, so the openings vary from round to round. They are all still optimal, which is the annoying part.
Can two people play on the same phone?
Yes. Switch to Two players and the computer stops taking turns. You pass the device back and forth, X then O, and those rounds are scored separately from your games against the computer.
Is it free, and does it work on mobile?
Free, with no download, no sign-up and no account. It runs in any browser. The board resizes to whatever screen it lands on and taps behave exactly like clicks.
Is my score saved?
In your own browser, yes, so it survives a reload and a restart. Nothing is sent to a server. Clearing your site data wipes it, and there is no copy anywhere to restore it from.
Does the game need JavaScript?
The board does. With scripts blocked you still get everything written on this page, but there will be nothing to play.