Random Number
Pick random numbers in any range, with or without repeats.
About the random number generator
Pick random numbers within any range you like. Ask for several at once, optionally require them all to be different β a draw without replacement, for lotteries, raffles and sampling β and sort the results if that helps.
Numbers come from crypto.getRandomValues, the browser's cryptographically
secure source, rather than Math.random(). Rejection sampling is used to map
those values onto your range, which matters more than it sounds: the obvious
value % range approach is measurably biased towards the low end whenever the
range does not divide evenly into the generator's period.
Frequently asked questions
Are these numbers really random?
They come from your browser's cryptographically secure random number generator, seeded by the operating system's entropy pool. That is far stronger than the ordinary Math.random(), and is the same class of source used for generating keys.
How do I generate numbers without duplicates?
Turn on "No repeats". Each value is then drawn without replacement, so no number appears twice. You cannot request more numbers than the range contains β ask for 10 unique values from 1 to 5 and the count is reduced automatically.
Can I generate lottery numbers?
Yes. Set the range to match your game β 1 to 59 for UK Lotto, 1 to 69 for the US Powerball main draw β set how many you need, and turn on "No repeats".
What is modulo bias?
It is the skew you get from mapping a random value onto a range with a simple remainder when the range does not divide evenly. Low values come up slightly more often. This tool discards and redraws values that would fall in the incomplete final bucket, which removes the bias entirely.