How a number is picked
The tool asks crypto.getRandomValues for a 32-bit unsigned integer, divides it by 232 to get a fraction in [0, 1), multiplies by the size of your range and rounds down. The range size is max - min + 1, so both ends are inclusive: with 1 and 6 you get 1 + floor(u × 6), which gives each of 1 to 6 with equal probability. This source is the browser's secure generator, not Math.random. Because 232 does not divide evenly by most range sizes, there is a tiny bias, about range / 4.3 billion. For a range of 100 that is far below one in a million, and irrelevant for games, raffles and classroom draws.
Repeats and "no repeats" mode
With repeats allowed, each number is an independent draw, so the same value can come up twice, just like rolling a die several times. With "No repeats" ticked, the tool lists every integer from min to max, shuffles the list with a Fisher-Yates shuffle (swapping each position with a random earlier one) and takes the first N. This is like drawing numbered balls from a bag. The total number of ways to draw 6 unique values from 1 to 49 is 49 × 48 × 47 × 46 × 45 × 44 / 720 = 13,983,816 combinations.
| Setting | Example | Possible outcomes |
|---|---|---|
| 1 to 100, one number, repeats allowed | 73 | 100 |
| 1 to 6, five numbers, repeats allowed | 2, 6, 6, 1, 4 | 65 = 7,776 |
| 1 to 49, six numbers, unique | 8, 17, 23, 31, 40, 46 | 13,983,816 (order ignored) |
Limits and edge cases
- Result count. You can ask for between 1 and 10,000 numbers at a time. Larger values are clamped.
- Unique needs room. If you request more unique numbers than the range holds, such as 8 from 1 to 5, you get an error instead of a short list.
- Decimals. Minimum and maximum are rounded down to whole numbers; the tool produces integers only.
- Huge unique ranges. No-repeat mode builds the whole range in memory, so unique results from something like 1 to 1,000,000,000 will be slow or fail. Use repeat mode there; collisions are rare.
- Max below min. This is rejected with a message.
Common mistakes
- Expecting evenly spread results. True randomness clusters. Seeing 7 twice in ten draws from 1 to 20 is normal, not a sign of a bug.
- Using it for official lotteries. It is fine for fair informal draws, but regulated draws need audited procedures and a record of the process.
- Re-rolling until you like it. If a draw has to be fair, generate once and accept the result.
For physical-style outcomes use the dice roller or the coin flip. To choose from a named list, the random picker is more convenient, and for secrets use the password generator.