How to use the random number generator
- Enter the minimum and maximum. Both are included.
- Choose how many numbers you want and how many decimal places.
- Tick No repeats if each number may appear only once, and Sort to list them from low to high.
- Press Generate. Press it again for a new draw.
The result also shows how many different values are possible and the chance of any particular one. With several numbers, use Copy numbers to paste them elsewhere.
Ideas for using random numbers
| Use | Settings |
|---|---|
| Roll a die | 1 to 6 |
| Roll two dice | 1 to 6, 2 numbers |
| Flip a coin | 0 to 1 (0 = heads, 1 = tails) |
| Pick a winner from 250 entries | 1 to 250 |
| Lottery 6 from 49 | 1 to 49, 6 numbers, no repeats, sorted |
| Random percentage | 0 to 100, 2 decimal places |
| Shuffle a list of 20 | 1 to 20, 20 numbers, no repeats |
How it works
A computer can't flip a coin, so it uses a random number generator. Ordinary generators in many programs are predictable if you know their starting point. This page uses the browser's cryptographic generator, which draws on unpredictable sources such as hardware timings.
Turning random bits into a number in your range needs care. Taking the remainder after division (the "modulo" method) makes some values slightly more likely than others. The generator here throws away the few draws that would cause that imbalance and tries again, so every value in your range has exactly the same chance. For decimals, it picks a random whole number of hundredths (or thousandths, and so on) in the range.
Nothing is sent to a server: the numbers are made on your device.
Frequently asked questions
Are the numbers truly random?
They come from your browser's cryptographically secure random number generator (the Web Crypto API), the same source used to create encryption keys. It's unpredictable and, unlike simple generators, suitable for draws and games. Each number in the range is equally likely: the calculator avoids the small bias that simple methods introduce.
How do I pick lottery numbers?
Set the minimum and maximum to the lottery's range, set how many numbers, and tick No repeats and Sort. For example, 6 numbers from 1 to 49. Every combination is equally likely, so no set of numbers is luckier than another.
Can I use this for a giveaway or raffle?
Yes. Number your entries from 1 to the total and generate one number (or more with No repeats for several winners). For transparency, share your screen or record the draw.
Are both ends of the range included?
Yes. A range of 1 to 6 can give 1, 2, 3, 4, 5 or 6, just like a die.