🔢 Number Guessing Game

Guess a hidden number using higher and lower hints, with easy, medium, hard and fully custom difficulty settings.

Choose Difficulty

Pick a difficulty level and start guessing!

🎯 Range:
🔄 Attempts:
🏆 Best:

How to play

1.

A random number is picked within the chosen range.

2.

Enter your guess and hit Guess!

3.

You'll be told if your guess is Too High or Too Low.

4.

Find the number before your attempts run out to win!

🎯

Range

🔄

Attempts left

⏱️

Time

Guess a number between and

( possibilities remaining)

Press Enter to guess

Guess History

🎉

You Got It!

The number was . Nice work!

Guesses

Time

Score

🏆 New Best!
😞

Out of Attempts!

The number was . Better luck next time!

Attempts used

Time

Your closest guess was (off by ).

Related Tools

The rules and the mathematics of guessing

At the start of a round the game selects a whole number at random within the active range and hides it. You type a guess and press Enter, and the game responds with too high, too low, or a win. Each guess costs one attempt, and the round ends when you find the number or the attempts run out.

The optimal strategy is binary search. Always guess the midpoint of the range that remains possible, because that response eliminates half of the remaining candidates whichever answer you get. Guessing anywhere else means one of the two possible answers leaves you with more than half still to search.

That gives a precise bound on how many guesses you need: the ceiling of log2 of the number of candidates. For 50 candidates that is 6, for 100 it is 7, and for 200 it is 8. Compare those against the attempt limits and something interesting emerges: Easy and Medium are always winnable with perfect play, since 10 and 7 attempts meet or exceed what is needed. Hard gives 5 attempts against a 200-number range, where 8 would be required to guarantee a win, so Hard demands luck as well as method.

Worked example: finding 73 on Medium

Play Medium, so the range is 1 to 100 with 7 attempts, and suppose the hidden number is 73.

Guess 1 is the midpoint, 50. The game says too low, so the range narrows to 51 to 100. Guess 2 is the midpoint of that, 75. Too high, so the range becomes 51 to 74. Guess 3 is 62, the midpoint of the 24 remaining candidates. Too low, narrowing to 63 to 74. Guess 4 is 68. Too low, narrowing to 69 to 74. Guess 5 is 71. Too low, narrowing to 72 to 74. Guess 6 is 73, and that is the answer.

Six guesses, one inside the seven allowed. Notice how each step roughly halved the field: 100 candidates, then 50, 24, 12, 6, 3, 1.

Contrast that with guessing from the bottom upward. Starting at 10 and stepping by 10 would reach 70 on the seventh guess without having found the number, and the round would be over. Even a reasonable-sounding opening guess of 25 wastes part of an attempt, because a too-low answer leaves 75 candidates rather than 50.

Improving your score and using the custom mode

Your score improves by finishing in fewer guesses, so discipline matters more than intuition. Recalculate the midpoint of the surviving range after every hint rather than guessing near your previous answer. When the remaining range has an even number of candidates, either midpoint is equally good, so do not overthink it.

The most common mistake is forgetting that the hints are cumulative. If 50 was too low and 75 was too high, the answer lies strictly between 51 and 74; guessing 40 at that point wastes an attempt on a number already ruled out. Keeping an eye on the guess history prevents this.

Custom mode is where the game becomes a teaching aid. The number of guesses needed is the ceiling of log2 of the range size, so 1 to 1,000 needs 10 and 1 to 1,000,000 needs 20. Setting a wide range with exactly that many attempts makes the point that halving is extraordinarily powerful, and that a linear search is hopeless by comparison.

Best scores are recorded per preset difficulty in your browser's local storage, so they persist on the same device but are not saved to any account.

Frequently Asked Questions

Guess the midpoint of whatever range remains possible after each hint. This halves the candidates every time, which is the fastest guaranteed method. After a too-low answer, the new range starts one above your guess; after a too-high answer, it ends one below. Any other guess risks leaving more than half the field in play.
Seven, at most, using midpoint guessing, because 2 to the power of 7 is 128, which exceeds 100. Many rounds finish sooner through luck. This is exactly why the Medium difficulty allows seven attempts: it is winnable every time with perfect play but leaves no room for a wasted guess.
Yes. Custom mode lets you set the minimum, the maximum and the number of attempts allowed, so you can make the game as gentle or as punishing as you like. It is useful for teaching binary search, since you can set the attempt limit to exactly the ceiling of log2 of the range size and see the method in action.
Yes. A new target is chosen at random at the start of every round, within whatever range the current difficulty defines, so a previous answer tells you nothing about the next one. There is no pattern to learn and no sequence to exploit; only the midpoint strategy improves your results consistently.
Yes, for each preset difficulty. Best results are kept in your browser's local storage, so they are still there when you come back on the same device and browser. They are not linked to an account, which means clearing your browsing data or playing on a different device starts you with a clean slate.