Skip to main content
L
Loopaloo
Buy Us a Coffee
All ToolsImage ProcessingAudio ProcessingVideo ProcessingDocument & TextPDF ToolsCSV & Data AnalysisConverters & EncodersWeb ToolsMath & ScienceGames
Guides & BlogAboutContact
Buy Us a Coffee
L
Loopaloo

Free online tools for developers, designers, and content creators. Your files are processed in your browser and are never uploaded - no accounts required. A few network utilities (like What's My IP and Currency Converter) call public APIs to do their job and say so on their pages.

support@loopaloo.com

Tool Categories

  • Image Tools
  • Audio Tools
  • Video Tools
  • Document & Text
  • PDF Tools
  • CSV & Data
  • Converters
  • Web Tools
  • Math & Science
  • Games

Company

  • About Us
  • Contact
  • Blog
  • FAQ

Legal

  • Privacy Policy
  • Terms of Service
  • Disclaimer

Support

Buy Us a Coffee

© 2026 Loopaloo. All rights reserved. Built with privacy in mind.

Privacy|Terms|Disclaimer
  1. Home
  2. Games
  3. Tic-Tac-Toe
Add to favorites

Tic-Tac-Toe

Tic-tac-toe against a minimax opponent, or a friend on the same device. Four difficulty levels, each a stated rate of playing a move that is not the best; on Impossible it cannot be beaten, proved by walking all 16,752 games.

No account, nothing trackedMore gamesJump to full guide

Initializing in your browser…

You might also like

Memory Match

Card matching with eight emoji themes, four difficulty sizes and four modes. The deal is a real Fisher and Yates shuffle, measured uniform over 60,000 boards, and a turn is a state machine so two fast clicks cannot strand a card face up.

Wordle

Guess the 5-letter word in 6 tries. Colour-coded hints, repeated letters marked correctly, and a live count of the answers that still fit your clues

2048 Game

Slide tiles to combine them and reach 2048. Each tile merges at most once per move, checked exhaustively against the rule, and the board total printed under the grid always equals everything ever spawned. Undo, touch controls and score tracking.

A sample round

You are X, the centre and a corner are yours, and it is your move.

Board (your move = top-right)

X | . | →X
. | X | .
. | . | O
What Tic-Tac-Toe produces

Result

You now threaten two lines at once, O cannot block both. Forced win.

Creating a "fork", two simultaneous winning threats, is the core tactic, because the opponent can only block one. With perfect play tic-tac-toe is always a draw, so a win only happens when the opponent fails to block a fork like this one, and on Impossible that never happens: playing every move the AI might pick against every move a person could make, from both sides, it does not lose one of 16,752 games. The whole tree is 5,478 positions, which is small enough that "unbeatable" is proved rather than claimed.

About this game

The classic X-and-O showdown, right in your browser. Challenge a friend or take on the computer, games last under a minute, making it perfect for a quick break.

How to play

  1. 1Choose to play against another person or the AI.
  2. 2Take turns placing your mark (X or O) on the 3×3 grid.
  3. 3First to get three in a row, horizontally, vertically, or diagonally, wins.

Tips & best practices

  • Set difficulty to Impossible to study perfect play: it never injects a random move (random chance 0), so with correct counter-play every game ends in a draw.
  • Use the numpad to play fast, it mirrors the board on screen, so 7-8-9 are the top row and 1-2-3 are the bottom row.
  • In vs-AI mode the Undo button (or Ctrl/Cmd+Z) steps back two moves at once, undoing the AI reply along with your move so you can retry a turn.
  • Drop the AI to Easy if you want to practice forks, it plays a random move about 70 percent of the time, leaving openings to exploit.

Controls and rules

  • Two-player and single-player modes
  • AI opponent with adjustable difficulty
  • Win/loss/draw score tracking

Examples

  • Beat a beatable AI on Easy

    Switch the difficulty to Easy, where the engine plays randomly 70 percent of the time. Set up a double threat (a fork) so two winning lines open at once, the random AI can only block one and you take the other.

  • Two-player hotseat

    Pick the 2 Players mode to play X and O on the same device, taking turns. Each result updates the session scoreboard and the persistent all-time stats and recent-match list.

How it works

The AI opponent is a minimax search that scores every position reachable from the board in front of it. A win is worth 10 minus the depth and a loss is the depth minus 10, so among two wins it takes the sooner and among two losses it takes the later, which is what makes a winning opponent finish rather than shuffle and a losing one make you work for it.

The claim that matters is that Impossible cannot be beaten, and tic-tac-toe is small enough that this is proved rather than asserted. There are 5,478 positions reachable in a legal game and the whole tree fits in a test: playing every move the AI might pick against every move a person could make, from both sides of the board, the AI does not lose one of 16,752 games. Going first it wins 7,056 and draws 3,584; going second it wins 2,528 and draws 3,584, which is the right shape, because the second player cannot force a win against good play, only punish a mistake. The same walk checks the engine against a second, independently written minimax on all 4,520 unfinished positions, and the two agree everywhere.

Difficulty is a stated rate rather than a vague setting: it is the chance the AI plays a move that is NOT among the best ones. Easy blunders seven times in ten, Medium three, Hard one, and Impossible never, measured over 20,000 draws at 69.2, 29.7, 10.1 and 0.0 percent. A blunder is only possible where a worse move exists; in a position where every move is equally good there is nothing to throw away, and the AI plays a good one.

The search also returns EVERY move that ties for the best value rather than the first one it finds, which is why there is no opening book. On an empty board all nine squares are drawn with perfect play, so the AI can open anywhere; if you take the centre, exactly the four corners are safe and those are the four it picks from. Both of those used to be hardcoded branches sitting next to the search, and they are now consequences of it, so they cannot drift out of agreement with the engine.

All progress persists in the browser via localStorage under keys like ttt-stats and ttt-history: it tracks total games, wins and losses against the AI, draws, current and best win streak, and a rolling log capped at the 50 most recent matches (each tagged with winner, mode, difficulty, move count, and timestamp). The interface is fully keyboard-playable, mapping the numpad to board cells in screen layout (7-8-9 across the top row, 1-2-3 across the bottom), with arrow keys to move a selection cursor, Enter or Space to place, Ctrl/Cmd+Z to undo, and N for a new game. Sound effects are synthesized live with the Web Audio API rather than loaded as files, using short oscillator tones (for example a 440 Hz sine blip on each move and a C5-E5-G5 arpeggio on a win), and the whole game runs client-side with no server round-trip.

Frequently asked questions

Can two people play on the same device?

Yes. Two-player mode lets you take turns tapping the same board.

Is the AI beatable?

On easier settings, yes: Easy plays a move that is not the best seven times in ten, Medium three and Hard one. Impossible cannot be beaten, and that is proved rather than claimed: walking every game it can be led into, from both sides, it does not lose one of 16,752. A draw is the best result available against it.

What exactly does a difficulty setting change?

The chance that the AI plays a move that is NOT among the best ones. Nothing else. Measured over 20,000 draws in a position with exactly one correct move, Easy blundered 69.2 percent of the time, Medium 29.7, Hard 10.1 and Impossible 0.0.

Why does the AI open in a different square each game?

Because on an empty board all nine are drawn with perfect play, so the search offers all nine and one is picked evenly. If you open in the centre it picks from the four corners, because those are the only replies that do not lose. Neither of those is a hardcoded opening; they fall out of the search.

Private by design

The game runs entirely in your browser. No account is needed and no gameplay data is collected.