Number Guessing Game
I'm thinking of a number. Can you guess it with as few attempts as possible?
?
Guess a number!
Your Guesses
About Number Guessing
Number Guessing is one of the simplest yet most satisfying logic games. The computer picks a secret number within a chosen range. You make guesses and receive hot/cold hints telling you how close you are. Using binary search thinking - always guessing the midpoint - you can find any number in the minimum number of guesses.
Controls
- Type a number - Enter your guess in the input field
- Guess button / Enter key - Submit your guess
- New Game button - Reset with a fresh secret number
- Range buttons - Switch between 1–50, 1–100, or 1–500
How to Play
- The computer picks a secret number within the selected range.
- Type a number and press Guess (or Enter) to submit.
- After each guess you get a hint: 🔥 Hot (within 5% of range), 🌡️ Warm (within 20%), ❄️ Cold (far away).
- You also get a direction clue: ▲ Higher or ▼ Lower.
- Try to find the number in as few attempts as possible.
- Your best score (fewest attempts in a win) is saved per range.
- Pro tip: start at the midpoint and halve the remaining range each guess.
Frequently Asked Questions
The default range is 1 to 100. Some difficulty levels extend the range to 1–500 or 1–1000 to make guessing harder.
Guess count depends on the difficulty. Easy mode gives more attempts; hard mode limits you to fewer. The optimal strategy for 1–100 with unlimited guesses is binary search, which always solves in 7 or fewer tries.
Yes. The secret number is generated using Math.random() seeded by the browser - a different number each game.
Always guess the midpoint of the remaining range. For 1–100: guess 50. If "too high", guess 25. If "too low", guess 75. This binary search approach always finds the answer in 7 or fewer guesses.