Random Number Generator
Pick whole numbers from a minimum to a maximum. Set how many, and whether repeats are allowed.
Smart Tips
• Both ends are included. A minimum of 1 and a maximum of 6 can return 1 and can return 6.
• Choose Unique when you need a sample without replacement. The quantity cannot exceed the width of the range.
• This is not a lottery picker and it does not simulate dice faces or a deck of cards.
• The range can hold at most 4,294,967,296 integers. Wider ranges are rejected.
The Formula
max − min + 1
2³² mod span
crypto.getRandomValues, or Math.random
min + accepted offset
A 32-bit word below the threshold is thrown away and another word is drawn. Every integer from the minimum through the maximum is then equally likely.
Key Insights
No modulo bias
A plain remainder favors some leftovers when the span does not divide 2³². Rejection removes that bias.
Repeats are a choice
Independent draws may repeat. Unique draws skip a number that has already appeared.
Browser randomness
crypto.getRandomValues is used when the browser has it. Math.random is the fallback, and the same rejection step still runs.
A fixed cap
Quantity stops at 1,000 so a single click cannot ask for an endless list.
Frequently Asked Questions
Note:Each accepted draw is equally likely inside the inclusive range. Rejected random words are not part of the result. This is not a lottery, a dice roller, or a source of passwords.