Random Number Generator, Dice Roller, Coin Flip and Picker
Free random number generator: pick numbers in any range with or without repeats, roll any dice (2d6, 4d6 drop lowest, d20 with advantage), flip coins, draw cards, shuffle or pick from a list, with history and statistics. Uses your browser's secure random generator.
Pick lottery numbers for fun
Every combination is exactly as likely as any other, so no picker (this one included) can improve your chances. These are just quick picks in each game's format.
How to write dice
2d6 | two six-sided dice, added |
|---|---|
d20+5, 3d8-2 | add or take away a fixed number |
d6+d8 | mix different dice |
4d6kh3 or 4d6 drop lowest | roll 4, keep the highest 3 (kl keeps the lowest, dh / dl drop) |
d20 adv / d20 dis | roll two d20s, keep the higher / lower |
3d6! | exploding: a die that shows its top number is rolled again and added |
d% | percentile die, 1 to 100 |
4dF | Fudge / Fate dice: each shows -1, 0 or +1 |
The odds for 2d6
Every total as a table
Heads so far this session
The line wobbles a lot at first and settles towards 50% the more you flip: that is the law of large numbers. A long streak is normal: in 100 flips the longest run of heads or tails is usually 6 or 7.
Your list stays in this browser only; it is never put in a link or uploaded.
How the fairness test works
The chi-square goodness-of-fit test compares how often each side came up with how often a fair one would show it on average. It adds up (observed - expected)2 / expected over every side. The p-value is the chance that a perfectly fair die (or coin) would look at least this uneven just by luck. A small p-value (under 0.05, and especially under 0.01) is a sign something is off; a large one means the results are what fair dice normally produce. It can never prove a die is fair, only fail to find a problem, and it needs enough rolls: each side should be expected at least 5 times.
Recent results
History is kept in this browser (it remembers counts, not every roll) until you clear it.
Reproducible (seeded) mode
Normally every result comes from your browser's secure random generator (crypto.getRandomValues) and can't be predicted or repeated. With a seed, the same seed always gives the same sequence of results from the moment the page loads, which is handy for classes, puzzles or checking someone's draw. Seeded results are not secure: anyone with the seed can repeat them.
A fair random number generator
Type the lowest and highest number, choose how many you want and press Generate. Tick No repeats to draw different numbers every time (like pulling numbered balls out of a bag), add decimal places for numbers like 3.72, sort them, or leave some numbers out (for example 7, 13, 20-25). The same page also rolls dice, flips coins, shuffles and deals cards and picks names from a list, and the Statistics tab keeps a history so you can test whether results look fair.
How the numbers are chosen
Every result comes from your browser's built-in secure random generator, crypto.getRandomValues, the same source used for passwords and encryption keys. A common mistake when turning a random 32-bit number into, say, 1 to 6 is to take the remainder after dividing by 6: because 4,294,967,296 does not divide evenly by 6, a few numbers then come up slightly more often. This page avoids that "modulo bias" with rejection sampling: random values from the uneven leftover part are thrown away and drawn again, so every number in your range has exactly the same chance.
Reproducible results with a seed
Teachers and puzzle makers sometimes need the same "random" results twice. Open Reproducible (seeded) mode at the bottom and type a seed, or add ?seed=class7 to the address. The same seed always gives the same sequence from the moment the page loads. Seeded results are predictable by design, so never use them for prizes, passwords or anything that must be secret.
Questions
- Is this truly random?
- It is cryptographically secure pseudo-randomness, seeded by your operating system from hardware noise. Nobody (including us) can predict or influence the next result, and nothing is sent to a server.
- Can I pick lottery numbers with it?
- Yes, the lottery buttons give quick picks in the format of common games, but no picker can improve your odds: every combination is equally likely. A 6/49 ticket has a 1 in 13,983,816 chance of the jackpot.
- How do I pick several different numbers?
- Set How many and tick No repeats. If you ask for more different numbers than the range holds (say 11 from 1 to 10) the page tells you instead of looping forever.
- How do I pick a random winner from names?
- Use the List picker tab: paste the names, one per line, and press Pick a winner. It can also pick several, shuffle the list or split it into teams.
- Is my data private?
- Yes. Everything runs in your browser. Your settings and history are saved only in this browser; the list of names is never put into a link.
Related: Dice Roller · Statistics Calculator · Percentage Calculator
