About this calculator
A random number generator is used for everything from contest winners to sampling in research, so where the randomness comes from matters. This page uses the browser's cryptographic generator rather than the ordinary Math.random function, which is faster but predictable and unsuitable for anything with stakes. For a genuine draw, the random choice should also be verifiable: publishing the seed or running the draw in front of participants removes any argument about tampering.
How it works
The browser cryptographic generator produces uniformly distributed 32-bit values, which are reduced into the range you specify. Rejection sampling is used so that values landing outside the range are discarded rather than folded, which avoids the slight bias that a simple modulo would introduce. For list picking, each item is indexed uniformly across the list length. For percentage giveaways, a value from 0 to 100 with two decimal places is drawn, which supports 100,000 entries.
Frequently asked questions
How do I generate a random number in a range?
Enter a minimum and maximum, set how many numbers you want, and the page draws them uniformly. Every integer between the two bounds has exactly the same chance of appearing, which is what makes it fair for draws and sampling. Repeat presses give independent results rather than a reshuffle of the same set.
How do I run a giveaway winner picker?
Choose the pick tool, paste one entry per line, and draw. The percentage tool is better for large lists, supporting up to 100,000 entries with two decimal precision, which avoids ties that a whole-number draw can produce. Publish your entry list and the draw time in advance so the result is auditable.
Is Math.random really not secure?
For casual uses it is fine, but it is not cryptographically secure. Its internal state can be reconstructed from a handful of observed outputs, so a determined person could predict subsequent results. For anything involving money, prizes or allocation of contested resources, a cryptographic source is the correct choice.
Can this produce duplicates?
Yes. Each draw is independent, so duplicates are expected and correct behaviour. With 10 numbers drawn from 1 to 100, roughly one duplicate is likely by the birthday paradox. If you need distinct values, note that this page draws independently rather than sampling without replacement.
What is the difference between d4, d6, d8 and d20?
Those are the faces of the die. The notation d20 means a die with 20 faces, and 2d6 means two six-sided dice rolled and added. Rolling more dice increases the range but flattens the distribution, so 2d6 cannot produce a 1 or a 12 while a single d12 can produce both.
How fair is this generator?
The browser cryptographic generator is designed to produce uniform output, and rejection sampling removes the bias that a naive modulo would introduce. That makes individual draws fair. What a generator cannot control is the selection process around it, so for contested results the entry list and the draw conditions should be published in advance.