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.
Question 1
💡
I think I know!
🎉
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
Think of something: any animal or an everyday object, food or vehicle. Keep it secret!
Press Start game and answer each question with Yes or No (or Not sure if you really can't tell).
Watch the counter: the game tries to reach a guess within 20 questions.
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.
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 asked
Most things you can tell apart (2n)
5
32
7
128
10
1,024
15
32,768
20
1,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
Stage
Example questions
Why they work
Opening
Is it alive? Is it bigger than a microwave? Is it found indoors?
Each splits almost everything roughly in half
Narrowing
Does it have legs? Is it made of metal? Can you eat it?
Sorts by body, material or use
Closing in
Does it live in water? Is it used in a kitchen? Is it a pet?
Picks a small group before guessing
Guessing
Is 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.