At a glance
This page flips one, two, three or five coins, or rolls one to four dice with 4, 6, 8, 10, 12 or 20 sides, and shows each individual result plus the total when you roll more than one die. It is meant for light decisions: who goes first, what to have for lunch, which of three chores to do now, or a quick roll during a tabletop game when your own dice are missing. Nothing you do here is saved or sent anywhere. The result exists only on your screen until you flip again or reload the page.
The basic principle: counting outcomes
A fair coin lands heads with probability 1/2, and each face of a fair n-sided die comes up with probability 1/n. Separate throws are independent, which means an earlier result carries no information about the next one. When you throw several objects at once, the probability of an event is simply the number of favourable outcomes divided by the total number of outcomes. For n coins the total is 2n; for c dice with s sides it is sc. Every table below is computed by that counting rule when this page is built, so none of the numbers were typed in by hand. They describe an ideal fair random source, which is what this tool aims to imitate.
Several coins: the chance of exactly k heads
The number of ways to get k heads out of n coins is the binomial coefficient "n choose k". Because every one of the 2n head-and-tail sequences is equally likely, the probability is that coefficient divided by 2n.
2 coins (4 possible sequences)
| Heads | Ways | Probability |
|---|---|---|
| 0 | 1 / 4 | 25.00% |
| 1 | 2 / 4 | 50.00% |
| 2 | 1 / 4 | 25.00% |
3 coins (8 possible sequences)
| Heads | Ways | Probability |
|---|---|---|
| 0 | 1 / 8 | 12.50% |
| 1 | 3 / 8 | 37.50% |
| 2 | 3 / 8 | 37.50% |
| 3 | 1 / 8 | 12.50% |
5 coins (32 possible sequences)
| Heads | Ways | Probability |
|---|---|---|
| 0 | 1 / 32 | 3.13% |
| 1 | 5 / 32 | 15.63% |
| 2 | 10 / 32 | 31.25% |
| 3 | 10 / 32 | 31.25% |
| 4 | 5 / 32 | 15.63% |
| 5 | 1 / 32 | 3.13% |
With two coins, "one head and one tail" has a probability of 50% because two different sequences (heads-tails and tails-heads) both qualify, while "two heads" is only 25%. People often expect three equally likely outcomes (two heads, one of each, two tails) and are surprised by this; the two coins are distinguishable even if you cannot tell them apart by eye.
Two dice: why seven is special
One die is uniform, but the sum of two dice is not. There is only one way to make 2 (1+1) or 12 (6+6), yet six ways to make 7.
| Sum | Ways | Probability |
|---|---|---|
| 2 | 1 / 36 | 2.78% |
| 3 | 2 / 36 | 5.56% |
| 4 | 3 / 36 | 8.33% |
| 5 | 4 / 36 | 11.11% |
| 6 | 5 / 36 | 13.89% |
| 7 | 6 / 36 | 16.67% |
| 8 | 5 / 36 | 13.89% |
| 9 | 4 / 36 | 11.11% |
| 10 | 3 / 36 | 8.33% |
| 11 | 2 / 36 | 5.56% |
| 12 | 1 / 36 | 2.78% |
A sum of 7 comes up 6 times in 36 (16.67%), and 2 or 12 only 1 time in 36 (2.78%) each. In any game that adds two dice, numbers near the middle are far more common than the extremes, and the more dice you add, the more bell-shaped the distribution of the total becomes.
Worked example 1: majority vote with five coins
Suppose five coins are flipped and "heads" wins if at least three show heads. From the five-coin table, the favourable counts are 10 + 5 + 1 = 16 out of 32 sequences, which is exactly 50%. A best-of-five coin vote is therefore as fair as a single flip, because an odd number of coins can never tie. The chance that all five land heads is 1/32, or 3.125%. That is small, but across a long evening of flipping, it is not shocking when it eventually happens.
Worked example 2: three dice, four dice and a d20
Roll three six-sided dice. There are 63 = 216 outcomes. A total of 15 or more can happen in 20 of them, which is 9.26%. Totals of 10 or 11 occur in 54 outcomes, or 25.00%, so the middle values are about three times as likely as the high ones. Roll four dice and ask for at least one six. It is easier to count the opposite: the chance of no six is (5/6)4, so the chance of at least one is 1 β (5/6)4 = 51.77%. Roughly half the time, four dice give you a six. With a d20, a single roll of 15 or higher has a chance of 6/20 = 30.00%. If a game lets you roll twice and keep the better result (often called advantage), you fail only when both rolls are 14 or lower, so the chance becomes 1 β (14/20)2 = 51.00%. That jump from 30% to 51% shows how strong such a rule is.
The gambler's fallacy and real coins
- After a streak of heads, tails is not "due". Each throw is independent, so the chance of heads on the next flip is still 1/2. The probability of five heads in a row, counted before you start, is 1/32, but once four have landed the fifth is again a plain 50/50.
- Short runs of identical results are normal. Three coins all matching has probability 2/8 = 25%, which happens in one session out of four. Judging a source as biased takes hundreds or thousands of trials, not a handful.
- A physical coin may not be perfectly even. A study of coin tossing by Diaconis and colleagues (2007) is often cited for the finding that a tossed coin has a slight tendency, in the order of a percent or so, to land on the same face that started upward. This page uses a computer random number, so that physical effect does not apply.
- The randomness comes from the browser's Math.random function. It is perfectly fine for games, tie-breaks and everyday choices, but it is not a cryptographic source and must not be used for security purposes such as passwords, tokens or keys.
- Do not use this page to settle anything involving money, a legal dispute, a prize draw with real stakes, or a medical decision. If other people need to trust the draw, use a method that all of them can observe and verify.
Choosing the right die for the job
Two options: one coin. Three to six options: a d6. Eight options: a d8. Ten options: a d10, reading the result as 1 to 10. Twelve options: a d12. If the number of options does not divide neatly into the number of faces, re-roll the unused results instead of folding them back. For five choices on a d6, for example, treat a 6 as "roll again"; mapping 6 to option 1 would make option 1 twice as likely as the others. For more complex needs, such as drawing several distinct numbers from a range, the random number generator is a better fit than a single die.
How to use the result
Decide the meaning of each outcome before you roll. Agreeing that "heads means we go to the cafe" after seeing the coin tends to start arguments. A useful trick is to notice your own reaction: if you feel a pang of disappointment when the coin lands, that disappointment is information about what you actually wanted, and you are free to follow it. In games, say out loud how many dice you are rolling and what the target is, so everyone at the table agrees on the rules before the roll.
Frequently Asked Questions
Can I see the total when I roll several dice?
Yes. Roll two to four dice and the page lists each result along with their sum. With a single die only the face value is shown, because the sum would be redundant.
The same result keeps coming up. Is it rigged?
Streaks are a normal feature of random sequences. Three flips matching has a 25% chance, and longer streaks appear regularly over many flips. A pattern in a few throws says almost nothing; only a very large number of trials could reveal a real bias.
Is the result calculated on a server?
No. When you press the button, a script on this page draws the result inside your own browser. Nothing is uploaded or stored, and reloading the page clears everything.
Can I use it for a prize draw or for anything security related?
It is intended for casual decisions and games. The randomness comes from Math.random, which is not designed for security, and a screen result is hard for other people to verify. For stakes that matter, use an auditable procedure that everyone can watch.
Why does the sum of two dice favour 7?
Because more combinations produce it. Six of the 36 equally likely pairs add up to 7, while only one pair gives 2 and one gives 12, as the table above shows.
Related tools
- Random number generator - pick numbers from a range you choose
- Lottery number generator - random combinations of numbers
- Team divider - split a group into random teams