Random number generator
Draw random numbers in any range, roll dice, flip coins or pick lottery numbers.
About Random Number Generator
This generator takes its randomness from your browser's cryptographic source, the same one used for security keys, instead of the weaker Math.random. Numbers in a range are chosen by rejection sampling, which throws away the few raw values that would make some results more likely than others, so every number in the range has the same chance. You can ask for many numbers at once, forbid repeats, sort the list, add decimals, roll several dice with a modifier, flip coins, or draw lines of lottery picks with no duplicates inside a line.
- Choosing a winner or an order for a draw or a class activity.
- Rolling dice for a tabletop game when you have none to hand.
- Making test data inside a known range.
- Drawing a lottery-style set of numbers without repeats.
How to use Random Number Generator
Step 1
Pick Numbers, Dice, Coin or Lottery picks.
Step 2
Set the range, the count and any options such as no repeats.
Step 3
Press Generate. Press it again for a fresh draw, and copy the result.
Good to know
- Random picks are independent. A lottery number that has not come up for months is no more likely to come up next, and no choice improves your odds.
- For no repeats, the count cannot be larger than the number of values in the range. The page tells you if it is.
- This is not an audited draw. For a prize draw that must be provably fair, use a process other people can watch or verify.
Common questions
Is this really random?
It uses crypto.getRandomValues, which your system seeds from hardware and operating system sources. It is suitable for games, draws and test data, and it is the same kind of source used for keys.
What is modulo bias?
Taking a random number and using the remainder after dividing by the range size makes some results slightly more likely when the range does not divide evenly. This tool rejects the uneven leftover values and draws again, so none is favoured.
How are decimals chosen?
The range is split into equal steps at the number of decimal places you set, and one step is picked evenly, so each possible value has the same chance.