Home › Fun & Games › Guess the Number Game

Guess the Number Game

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.

Your guesses

    Advertisement
    Advertisement

    How to use the Guess the Number Game

    1. Pick a range: 1–10 for a quick round, 1–100 for the classic game, 1–1000 or a custom range for a challenge.
    2. Choose your hints: higher/lower tells you which direction to go; warm/cold tells you how close you are.
    3. Type a guess and press Enter. The range bar and guess list update after each try.
    4. Narrow it down by guessing the middle of the numbers that are still possible until you hit the secret number.
    5. 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) ⌉

    RangeNumbers (N)Max guesses with binary search
    1 – 10104
    1 – 1001007
    1 – 1,0001,00010
    1 – 10,00010,00014
    1 – 1,000,0001,000,00020
    1 – 1,000,000,0001,000,000,00030

    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.

    Related tools

    Random Number GeneratorPick random numbers in any range, unique or lottery-style.Math Quiz GameTimed mental math rounds with four operations, five levels, streaks and high scores.Word Guess GameGuess the hidden five-letter word in six tries. Unlimited games, stats and hard mode.Number Memory TestRemember a number that grows one digit each level. Track your digit span and best score.SolitairePlay classic Klondike Solitaire with Draw 1 or Draw 3 and undo.Spider SolitairePlay Spider Solitaire online with 1, 2 or 4 suits, hints, unlimited undo and a timer.Play Chess vs ComputerPlay chess online against the computer at 8 difficulty levels.Connect FourPlay Connect 4 online against the computer or a friend.Snake GamePlay classic Snake online with speeds, wall modes and high scores.Tic Tac ToePlay tic tac toe against an unbeatable AI or a friend.Block Puzzle GameClassic falling blocks puzzle game with levels and high score.MinesweeperPlay classic Minesweeper: 3 difficulties, flags, timer and a safe first click.2048 GamePlay 2048 online with swipe controls, undo and best score.Sudoku OnlinePlay free Sudoku with 4 difficulty levels, notes, hints and a timer.HangmanClassic friendly hangman word game with categories, hints and difficulty levels.Memory Card GameFlip cards and match emoji pairs on 4×3 to 6×6 grids, with moves, timer and best scores.Flappy GameTap to flap a round chick through bamboo gaps and beat your high score.Dino Runner GameJump cacti and duck buzzing beetles in an original endless desert runner.Typing GameType the falling words before they land; level up and track your WPM and accuracy.Flag QuizGuess the flags of all 196 countries in four modes, from multiple choice to timed.Map QuizFind countries on a clickable world map or name the highlighted one, by continent.Periodic Table QuizLearn all 118 elements: quiz symbols, names and atomic numbers or click them on the table.Spelling Bee GameMake words from 7 honeycomb letters, always using the center letter. New daily puzzle.Jigsaw PuzzleTurn a sample picture or your own photo into a 12 to 150 piece jigsaw puzzle and solve it.Sliding PuzzlePlay the 15 puzzle and 3×3 to 6×6 sliding tile puzzles with numbers or your own photo.Mahjong SolitaireMatch pairs of free tiles to clear the Turtle and two smaller layouts, with hints, shuffle and undo.Scrabble Word FinderFind the highest-scoring words from your rack, with blank tiles, patterns and bingo bonus.Wordle SolverEnter your guesses and colours to see every possible answer and the best next guess.Crossword SolverFind words that fit a crossword pattern like c?t from the length and the letters you know.Word Search GeneratorMake a word search puzzle from your words, play it online or print it with an answer key.Pong GamePlay classic Pong online against the computer on 3 levels or with a friend, first to 11.Breakout GameClassic brick breaker game with levels, power-ups and lives. Play with mouse, touch or keyboard.Whack-a-MoleWhack the moles before they hide in 30 or 60 second rounds. Speed increases, best score saved.Simon Says GameRepeat the growing color and sound sequence. Classic memory game with strict mode and high score.CheckersPlay checkers online against the computer or a friend, with kings, undo and hints.ReversiPlay Reversi (Othello rules) online vs a 3-level computer or a friend, with move hints.GomokuGet five in a row on a 15×15 board against a smart computer or a friend.Battleship GamePlace your fleet and sink the computer's ships in this classic naval guessing game.Bible Trivia QuizMultiple-choice Bible trivia by book and difficulty, with verse references and a kids mode.Contract BridgePlay contract bridge with 3 computer players: SAYC-style bidding, declarer play, duplicate scoring.Chess Analysis BoardSet up positions, paste FEN or PGN and step through moves with an engine evaluation bar.Guess the Country by ShapeWorldle-style geography game: name the country from its outline in six tries, with distance hints.Cryptogram PuzzleCrack a substitution cipher letter by letter to reveal a famous saying. Daily puzzle, hints, timer.Element Mixing GameMix water, fire, earth and air to discover 400+ items. Discovery book, hints, works offline.EuchrePlay Euchre online with a computer partner: order up trump, use the bowers, go alone, race to 10.Falling Sand GameSandbox with sand, water, fire, plants, lava and more that flow, burn, grow and react. Save your scene.Forehead Guessing GameHeads-up style party game: hold the phone to your forehead, tilt down if correct, up to pass.Fruit Merge GameDrop fruits into the box and merge matching ones into bigger fruit, all the way to a watermelon.Fruit Slice GameSwipe to slice tossed fruit, dodge the rocks and chain combos. Three lives, mouse or touch.Conway's Game of LifeDraw cells and watch them evolve: play, step, change speed, load gliders and guns, import RLE.Online Game Show BuzzerQuiz buzzer for 2–8 teams on one device: first key or tap locks out the rest with sound.Games for CatsFull-screen mice, laser dot, fish and bugs for cats to chase on a tablet, with squeaks and a tap counter.Kids General Knowledge QuizFun quiz for kids aged 5–12 on animals, space, geography and science, with read-aloud and stars.Go FishKid-friendly Go Fish card game vs the computer: ask for ranks, make books of four, voice prompts.Go Game (Baduk)Play Go on 9×9, 13×13 or 19×19 vs a simple AI or a friend, with ko, scoring and SGF export.Higher or Lower GameIs the next one higher or lower? Compare country populations, areas, buildings and mountains.Imposter Word GamePass-the-phone party game: everyone gets the secret word except the imposter. Clue, vote, reveal.Calcudoku Math PuzzleSolve KenKen-style cage arithmetic puzzles from 3×3 to 9×9, each with a unique solution.Logic Grid PuzzlesSolve Einstein-style deduction puzzles with clues and an ✗/✓ grid, from easy to hard.Math Equation Guess GameNerdle-style math puzzle: find the hidden 8-character equation in six tries. Daily and unlimited.Maze Chase GameArcade maze game: eat every dot, grab power pellets and dodge four ghosts. Levels, lives and high score.Mini Golf GamePlay 18 holes of top-down mini golf: drag to putt past windmills, water and sand, with a scorecard.Connect the Dots Flow PuzzleDraw lines to join matching colored dots and fill the whole board without crossings. 5×5 to 12×12.Car Parking PuzzleSlide the blocking cars and trucks to free the red car. 120 graded levels with hints.Peg SolitaireJump pegs over each other until only one is left. English, European and triangle boards with hints.Pipes PuzzleRotate pipe tiles to connect every pipe to the source with no leaks. 5×5 to 15×15, wrap mode, timer.Pop It GameVirtual pop-it fidget toy with pop sounds, shapes and colors, plus a two-player last-pop game.Rebus PuzzlesPicture-word brain teasers like MIND over MATTER, with hints, answers and printable sets.
    See all 141 Online Games →