739 152
?

Guess the Number

Guess a number between 1 and 100

Guess a number between 1-100, I will tell you if it's too high or too low!

Total Games0
Best Score-
Avg Score0

🏆 Join the Leaderboard!

🔒 Only nickname & score stored. No tracking.

How to Play

The computer picks a secret number between 1 and 100. Your job: find it using as few guesses as possible.

  • Guess a number —type it in and submit
  • Get a hint —the game tells you "Too High" or "Too Low"
  • Narrow the range —use the hint to eliminate half the possibilities
  • Repeat —until you find the secret number

Winning Strategies

  • Always guess the middle -- pick the number halfway between your current low and high bounds
  • Update both bounds -- after "Too High", set high = guess - 1; after "Too Low", set low = guess + 1
  • Watch the range shrink -- each guess eliminates half the remaining numbers
  • Avoid random guessing -- it might feel faster but it's mathematically worse

The Science Behind

Every guess cuts the possibilities in half. That's Binary Search -- the same algorithm that powers database indexes, spell checkers, and even COVID testing strategies.

Max Guesses = ceil(log2(Range))

For 1-100: 7 guesses or fewer -- guaranteed.

Finding the number 73 in action:

50
Too Low
75
Too High
63
Too Low
69
Too Low
72
Too Low
73
Win!

This is the same algorithm used by databases, search engines, and medical testing. Read the full deep-dive →

Frequently Asked Questions

💡 What is the best strategy?

Binary Search: always guess the middle of the remaining range. This guarantees finding any number from 1—00 in ≤ guesses.

📈 What's the minimum guesses needed?

With perfect play: 4 guesses (1-10), 6 (1-50), 7 (1-100), 10 (1-1000). A lucky first guess wins in 1 —but that's pure chance.

💡 How do hints work?

"Too High" means your guess is above the secret number. "Too Low" means it's below. Each hint eliminates half the remaining possibilities.

🧠 Why is this good brain training?

It teaches binary search —a fundamental computer science algorithm. You practice logical reasoning, estimation, and systematic problem-solving.

Try These Next