UtilityToolsLab

© 2026 UtilityToolsLab. Built and maintained by the UtilityToolsLab Team.

Free eBooks·About·Changelog·Privacy Policy·Terms of Service·Report a bug
HomeBoard & Card GamesTic-Tac-Toe

Related Tools

Tic-Tac-Toe — Play vs Unbeatable AI

Play noughts and crosses against an easy, medium or unbeatable computer, or a friend on the same screen, with a running score and win/draw/loss move hints.

You Might Also Like

All Board & Card Games

Dice Roller

Roll d4 through d100 with standard dice notation like 2d6+3, a running history, and cryptographically random results. No physical dice required.

Word Counter

Count words, characters, sentences, paragraphs, lines and reading time as you type, with live keyword density analysis. Free and private.

Case Converter

Convert text between UPPERCASE, lowercase, Title Case, Sentence case, camelCase, PascalCase, snake_case, and kebab-case.

Paragraph Formatter

Clean and reformat text by removing extra spaces, collapsing blank lines, trimming each line, or joining into a single line.

Played well by both sides, tic-tac-toe always ends in a draw. That makes the unbeatable computer here a fair test: you cannot beat it, but you can learn never to lose to it. Easy and medium levels leave room to win while you practise.

This Tic-Tac-Toe also works as a two-player game on one screen, and it keeps score across games until you reset it. Nothing to install, and no account.

Getting a Draw Against the Unbeatable Level

  1. Choose Computer, set Difficulty to Unbeatable, and pick X to move first or O to move second.
  2. Turn on Show Move Outcomes; every empty square is labelled win, draw or loss for you.
  3. Only ever play a square marked draw (or win, if one appears).
  4. Try a corner opening for X in Friend mode: the outcomes show that only the centre keeps the draw for O.
  5. Press New Game to go again; Reset Score clears the tally.

How the Math Picks a Move

The hard level searches the whole game tree with negamax and remembers every position it has scored. There are only 5,478 reachable positions, so the search finishes instantly. Wins are worth more the sooner they come, which is why the computer finishes a game rather than wandering, and among equal moves it prefers the centre, then corners, then edges. Checked against every possible line of opponent play, it won or drew all 613 resulting games, playing first or second.

Limits of Easy and Medium

  • Easy plays at random but never misses a win that is one move away.
  • Medium plays the perfect move 60% of the time and a random one otherwise, so it can be beaten with a fork.
  • The computer waits 380 ms before moving, so you can see its reply land.

A finished draw reads “Draw. Nobody can win with perfect play, so this is the expected result.” Scores reset when you switch between Computer and Friend.

Opponent

Difficulty

You play

You (X)

0

Draws

0

Computer (O)

0

Your move (X)

Move outcomes label every empty square win, draw or loss for the player to move, assuming both sides play perfectly from there.