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. All processing happens entirely in your browser - your files never leave your device. No uploads, no accounts, complete privacy.

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

Classic tic-tac-toe game with AI opponent using minimax algorithm. Three difficulty levels: Easy, Medium, Hard

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.

No account, nothing trackedMore gamesJump to full guide

Initializing in your browser…

You might also like

Memory Match

Card matching memory game with 4 emoji themes (animals, food, sports, nature), 3 difficulty levels, and timer

Wordle

Guess the 5-letter word in 6 tries. Color-coded hints show correct, present, and absent letters. Track your stats and streaks.

2048 Game

Slide numbered tiles to combine and reach 2048! Features touch/swipe support, undo functionality, 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
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.

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 driven by a minimax search with alpha-beta pruning that recursively scores every reachable board position. Terminal states are scored as 10 minus the search depth for an AI win, depth minus 10 for a player win, and 0 for a draw, so the depth penalty makes the AI prefer the fastest win and the slowest loss rather than treating all wins as equal. Difficulty is implemented by mixing a random move into the search: before each turn the engine rolls against a per-level chance (Easy 0.7, Medium 0.3, Hard 0.1, Impossible 0), and on a hit it plays a uniformly random empty cell instead of the minimax move. That means Easy throws away roughly 70 percent of its turns to randomness and is very beatable, while Impossible never deviates from optimal play and, because tic-tac-toe is a solved draw, can be tied but never defeated.

On Hard and Impossible the AI also applies hard-coded opening heuristics before falling back to minimax: on an empty board it takes the center (cell 4) with 50 percent probability or otherwise a random corner from cells 0, 2, 6, 8, and if you open in the center it responds by grabbing a random free corner. Beyond the engine, the tool runs two modes selectable in the sidebar: vs AI, and a shared-device 2 Players hotseat where X and O alternate on the same board. In vs AI you can pick your symbol (X or O), choose who moves first (You, AI, or Random), and Undo rolls back two plies at once (your move plus the AI reply) so you effectively retry a turn rather than just one half-move.

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, definitely. On the hardest setting, the best you can do is a draw, just like the real game.

Private by design

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