The computer picks a secret number and you track it down with higher/lower or warm/cold hints. Or flip it around: think of a number and watch the computer find it in a handful of tries with binary search.
Last updated:
Range
Attempts0
Left∞
Time0:00
Best–
I'm thinking of a number between 1 and 100.
Type a number and press Enter.
1Still possible: 1–100100
Your guesses
Computer's tries0
Max needed7
Numbers left100
Think of a whole number between 1 and 100. Keep it secret!
Is your number…50
Keys: ↑ too low · ↓ too high · Enter correct
1Search range: 1–100100
How the computer narrows it down
Advertisement
Advertisement
How to use the Guess the Number Game
Pick a range: 1–10 for a quick round, 1–100 for the classic game, 1–1000 or a custom range for a challenge.
Choose your hints: higher/lower tells you which direction to go; warm/cold tells you how close you are.
Type a guess and press Enter. The range bar and guess list update after each try.
Narrow it down by guessing the middle of the numbers that are still possible until you hit the secret number.
Switch to Computer guesses, think of a number, and answer Too low, Too high or Correct to watch binary search find it.
The math behind the perfect guess
Each higher/lower answer splits the remaining numbers into two parts. If you always guess the middle, the part you keep is never more than half, so after k guesses at most N / 2k numbers are left. That gives the worst-case number of guesses with perfect play:
guesses needed = ⌈ log2(N + 1) ⌉
Range
Numbers (N)
Max guesses with binary search
1 – 10
10
4
1 – 100
100
7
1 – 1,000
1,000
10
1 – 10,000
10,000
14
1 – 1,000,000
1,000,000
20
1 – 1,000,000,000
1,000,000,000
30
Doubling the range adds only one extra guess. That is why binary search is used everywhere in computing, from looking up words in a sorted dictionary to finding the commit that introduced a bug.
Tips for each hint mode
Higher / lower: keep track of the lowest and highest numbers still possible (the green band on the bar) and guess halfway between them.
Warm / cold: you don't know the direction, only the distance. Make a first guess, then jump to one side: if you get warmer, keep going that way; if you get colder, the number is on the other side.
Both: use higher/lower to pick the side and the temperature to judge how far to jump. A "boiling hot" hint means you are within a couple of percent of the range.
Challenge mode gives you exactly as many attempts as perfect binary search needs, so a single careless guess can cost you the round.
Frequently asked questions
What is the best strategy for guess the number?
Always guess the middle of the numbers that are still possible. Each higher/lower answer then removes half of the remaining numbers, so 1 to 100 never takes more than 7 guesses and 1 to 1000 never more than 10. This strategy is called binary search.
How many guesses do you need to find a number between 1 and 100?
With perfect play at most 7, because 2 to the power of 7 is 128, which is more than 100. In general the worst case is the base-2 logarithm of (N + 1), rounded up, where N is how many numbers are in the range.
How do warm and cold hints work?
The hint depends on how far your guess is from the secret number compared with the size of the range: within about 2% is boiling hot, 5% hot, 10% warm, 20% cool, 40% cold and anything further is freezing. You are also told whether you got warmer or colder than your previous guess.
How does the computer guess my number so fast?
It uses binary search. It guesses the middle of the range, and each time you say too high or too low it throws away the half that can't contain your number. That is why it needs at most 10 guesses for 1 to 1000 and about 30 for a billion numbers.
What happens if I give the computer a wrong answer?
If your answers contradict each other, the search range becomes empty and the game tells you that no number fits. Press Start over and try again with the same secret number.
Is the secret number really random?
Yes. It is picked in your browser with the Web Crypto random number generator, evenly across the whole range, and it never leaves your device.
Is this game good for kids?
Yes. The 1 to 10 and 1 to 100 rounds are great for practising number order and comparison, and the reverse mode is a simple, visual introduction to how computers search efficiently.
Are all the tools on FreeToolCabin tested for quality and accuracy?
Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.