Classic X's and O's — now with an AI opponent. Three difficulty levels. Can you beat the unbeatable hard mode?
You (X)
0
Draws
0
AI (O)
0
Press New Game to start!
You are X · AI is O
How to Play Tic Tac Toe
You play as X and the AI plays as O. Take turns clicking squares on the 3×3 grid. Get three of your marks in a row — horizontally, vertically, or diagonally — to win. The AI gets smarter with each difficulty level:
Easy — the AI plays mostly random moves, perfect for beginners. Medium — the AI blocks obvious wins and takes them when it sees one. Hard — the AI uses the minimax algorithm and is truly unbeatable. The best you can do is draw!
Tic Tac Toe — FAQs
Can I actually beat the hard mode AI?
No — Hard mode uses the minimax algorithm which plays a perfect game every time. It will never make a mistake. The best outcome you can achieve is a draw by also playing perfectly.
How does Medium difficulty work?
The Medium AI checks if it can win on its next move, and if not, whether it needs to block your winning move. Otherwise it picks a random available square — so it can be beaten with the right strategy.
Does the score reset when I refresh?
The score is tracked for your current session only and resets when you refresh the page or close the browser tab.
Can I play against a friend instead of the AI?
Currently the game is single-player vs AI only. A two-player local mode (pass-and-play) may be added in a future update.