Home › Fun & Games › 20 Questions Game

20 Questions Game

Think of an animal or an everyday object, then answer the yes/no questions. The game follows a decision tree to guess what you picked in 20 questions or fewer, and if it gets it wrong, you teach it a new question so it gets smarter on your device.

Last updated:

Question 0 of 20

Think of an animal or an object…

I already know 0 things. Keep it secret and I'll try to guess it.

Keyboard: Y yes, N no, ? not sure, U undo.

Games0
I guessed it0
You stumped me0
Things I know0

Your answers

    Your questions and answers appear here as you play.

    What I know & saving my brain

    Advertisement
    Advertisement

    How to use the 20 Questions Game

    1. Think of something: any animal or an everyday object, food or vehicle. Keep it secret!
    2. Press Start game and answer each question with Yes or No (or Not sure if you really can't tell).
    3. Watch the counter: the game tries to reach a guess within 20 questions.
    4. Confirm the guess: tap Yes if it's right. If it's wrong, type what you were thinking of and a yes/no question that tells the two apart.
    5. Play again: the game now knows your item. Use Export to save or share what it has learned.

    Why 20 questions are enough

    Every yes/no answer can at best cut the remaining possibilities in half. After n perfect questions you can tell apart 2n different things, so 20 well-chosen questions are enough to single out one item among more than a million. Real questions are never perfectly balanced, which is why some guesses come quickly and others take longer.

    Questions askedMost things you can tell apart (2n)
    532
    7128
    101,024
    1532,768
    201,048,576

    This game starts with a balanced tree: when it was built, each question was chosen so that the things it knows split as evenly as possible into a yes group and a no group. That keeps most guesses to about 6 to 9 questions.

    How the learning works

    The game stores its knowledge as a binary decision tree. Every branch is a question and every end point (leaf) is a guess. When a guess is wrong, the leaf is replaced by your new question, with your item on one side and the wrong guess on the other. Nothing is overwritten, so the tree only grows. This is the same idea as the classic "guess the animal" program that has been used to teach programming for decades.

    • Write questions that are clearly yes or no for both items, such as "Does it have spines?" rather than "What color is it?".
    • Prefer facts everyone agrees on (number of legs, where it lives, what it is made of) over opinions like "Is it cute?".
    • Keep the item name simple: "hedgehog", not "my neighbor's hedgehog".

    Good questions for playing with friends

    StageExample questionsWhy they work
    OpeningIs it alive? Is it bigger than a microwave? Is it found indoors?Each splits almost everything roughly in half
    NarrowingDoes it have legs? Is it made of metal? Can you eat it?Sorts by body, material or use
    Closing inDoes it live in water? Is it used in a kitchen? Is it a pet?Picks a small group before guessing
    GuessingIs it a dolphin?Only guess when one or two options are left

    Frequently asked questions

    How do you play 20 Questions?

    One player thinks of a person, place or thing and keeps it secret. The other player asks up to 20 questions that can only be answered yes or no. If the guesser names the secret thing within 20 questions, they win; otherwise the player who chose it wins. In this version the computer is the guesser and you are the one keeping the secret.

    How does the game guess what I'm thinking?

    It uses a binary decision tree. Every question splits the things it knows into two groups, yes and no, and your answer tells it which branch to follow. A good question removes roughly half the possibilities, which is why 20 questions are enough in theory to tell apart about a million (2 to the power of 20) different things.

    How does the game learn?

    When a guess is wrong, you tell it the right answer and write a yes/no question that is true for one item and false for the other. The game replaces the wrong guess with your question and both items, so the next time someone gives the same answers it can tell them apart. This is the classic 'animal guessing' learning program used in computer science classes.

    Is what I teach it shared with other people?

    No. The learned tree is stored in your browser's local storage on this device only and is never uploaded. To share it, press Export to download a JSON file and Import it on another device or browser.

    What should I think of for the best results?

    The starting tree knows common animals (pets, farm, wild, sea creatures, birds and bugs) and everyday objects such as furniture, vehicles, foods, clothes, tools and electronics. Anything else works too, but the first time it will probably have to ask you to teach it.

    What does Not sure do?

    If a question doesn't really fit your item, Not sure follows the branch that leads to more possible answers, which is the safest bet. You can also press Undo to go back one question at any time.

    What are good tips for playing 20 Questions with people?

    Start with broad questions that split everything in half, such as 'Is it alive?' or 'Is it bigger than a breadbox?', then get more specific. Avoid guessing a specific item too early, keep track of what you already know, and use questions about size, color, where it is found and what it is used for.

    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

    Word Guess GameGuess the hidden five-letter word in six tries. Unlimited games, stats and hard mode.Trivia Quiz300+ general knowledge trivia questions in 10 categories. 10-question rounds with a timer and score.Emoji QuizGuess the word, phrase, animal, food or movie from emoji clues. 370+ puzzles with hints.Random Animal GeneratorGet a random animal with its class, habitat and a fun fact, with filters.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.Math Quiz GameTimed mental math rounds with four operations, five levels, streaks and high scores.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.Guess the Number GameGuess the secret number with higher/lower or warm/cold hints, or let the computer guess yours.Hearts Card GamePlay Hearts online against 3 computer players: pass cards, dodge the Queen of Spades, shoot the moon.Kakuro PuzzlePlay generated cross-sum kakuro puzzles in several sizes with pencil marks and a combination helper.Killer SudokuPlay generated killer sudoku puzzles with cage sums, pencil marks, a cage combo helper and hints.Ludo GamePlay Ludo online with 2-4 players or against the computer: roll, capture and race home.Match 3 GameSwap gems to match 3 or more, trigger cascades and special gems, and beat each level's target.Snakes and LaddersPlay the classic board game online with 2-4 players or against the computer.Space Shooter GameRetro arcade space shooter: blast alien waves and meteors, grab power-ups and beat your high score.Spades Card GamePlay Spades online with a computer partner: bid tricks or nil, trump with spades, avoid bags.Stack Tower GameTap to drop sliding blocks and build the tallest tower. Perfect drops earn bonus points.US States QuizFind the 50 states on a clickable US map, type them all from memory, or match state capitals.Virtual Bubble WrapPop endless bubble wrap with click, touch or drag. Satisfying pop sounds and a pop-it fidget mode.Word Grid GameFind words in a 4x4 or 5x5 letter grid by dragging across adjacent letters before time runs out.Word Ladder GameChange one letter at a time to turn one word into another. Daily and random word ladders.Chess PuzzlesSolve chess puzzles online: mate in 1, 2 and 3 plus tactics, with hints, a rating and streaks.Clicker GameIdle clicker: mine gems, hire builders, buy upgrades, rebirth for stars and earn while you're away.Color by NumberTap numbered pixels to color pictures, or turn your own photo into a color by number puzzle.Online Coloring PagesColor animal, holiday and mandala pages online with bucket fill and brushes, then print or save PNG.Connections Word PuzzleGroup 16 words into 4 hidden categories. New daily puzzle, full archive, shareable results.Daily Crossword PuzzleA free new crossword every day: quick 5x5 mini or a bigger 13x13, with check, reveal and timer.Farkle Dice GamePlay Farkle online vs the computer or pass-and-play: pick scoring dice, risk it or bank to 10,000.Gin RummyPlay Gin Rummy vs the computer: draw, discard, knock or go gin. Melds found automatically.Jeopardy-Style Quiz Board MakerMake a categories-and-points quiz board, then play it full screen with teams and live scores.Name All Countries QuizType as many of the world's 197 countries as you can in 15 minutes while the map fills in.Piano Tiles GameTap the black tiles to play classic melodies. It speeds up as you go; beat your high score.Pinball GamePlay pinball online with real flipper physics, bumpers, a wire ramp, drop targets and multiball.8 Ball Pool GamePlay 8 ball pool online vs the computer or a friend: aim line, power meter, spin and real physics.Cube SimulatorTurn a 3D 2x2 to 5x5 puzzle cube online: drag or type moves, scramble, time solves and undo.TriPeaks SolitairePlay TriPeaks Solitaire free: clear three peaks with up-or-down runs, streak bonuses, undo and hints.Water Sort PuzzlePour colored water between tubes until every tube holds a single color. Endless solvable levels.
    See all 141 Online Games →