Understanding the yes or no generator — concept and principle
This tool gives a random yes or no, or yes, no or maybe, to any question you type. Each answer is exactly equally likely, like a fair coin flip. Use it to break a tie on small everyday choices, such as what to eat or which film to watch.
How it is calculated
Chance of each answer = 100 % ÷ number of possible answers
- Yes or no: 1 in 2 = 50 %. Yes, no or maybe: 1 in 3 ≈ 33.3 %.
- A random whole number is drawn from your browser's cryptographic generator (crypto.getRandomValues).
- Rejection sampling: numbers in the uneven top part of the range are thrown away and drawn again, then the remainder after dividing by 2 or 3 picks the answer.
- The question is not read or analysed. The answer stays the same until you change an input; change the draw number to ask again.
The principle
A fair random choice needs two things: an unpredictable source and an unbiased way of mapping it to answers. Browser cryptographic generators are designed to be unpredictable. The mapping is where bias can creep in: a 32-bit number has 4,294,967,296 possible values, which does not divide evenly by 3, so simply taking the remainder would make some answers very slightly more likely. Discarding the few values at the top of the range that would cause the imbalance removes that bias completely.
Worked example
Default inputs: question "Should I order pizza tonight?", yes or no, draw number 1.
- Possible answers = 2, so the chance of each is 100 ÷ 2 = 50 %.
- A random number is drawn and kept only if it lies below the largest multiple of 2 that fits in the range; with 2 answers every value qualifies.
- Its remainder after dividing by 2 picks the answer: 0 for yes, 1 for no.
- When this page was checked the draw gave Yes ✓ for draw number 1; your screen may show a different answer, because every draw is random.
How to read the result
The answer carries no information about your question. That can still be useful: people often notice whether they feel relieved or disappointed by the result, which tells them what they really wanted. Asking again until you get the answer you like is a sign you already know.
Common mistakes
- Treating the answer as advice or a prediction.
- Expecting answers to alternate; each draw is independent.
- Thinking that three yeses in a row make a no more likely.
- Using it for decisions with real consequences.
Frequently asked questions
Is the yes or no generator truly random?
It uses the browser's cryptographic random generator, which is designed to be unpredictable, and an unbiased mapping.
Why does the answer not change when I click again?
It stays fixed until an input changes; change the draw number to ask again.
What is the chance of three yeses in a row?
1 in 8, or 12.5 %.
Sources: W3C Web Cryptography API, crypto.getRandomValues · D. E. Knuth, The Art of Computer Programming, Vol. 2, §3.4.1