How the random number generator works
This generator produces whole numbers for drawings, sample data, games, classroom exercises, and other everyday choices. You control the inclusive minimum and maximum, the quantity, and whether a value can appear more than once.
Method and behaviour
The range includes both endpoints. The minimum is rounded up and the maximum is rounded down so the output always contains integers. Random values come from crypto.getRandomValues in the browser. Rejection sampling removes modulo bias when the browser's 32-bit range is not evenly divisible by the requested range.
With No duplicates selected, each accepted value is checked against earlier results. The request is rejected when the quantity is larger than the number of available integers. Without that option, every draw is independent and repeats are possible.
Worked example
A six-number draw from 1 to 49 with No duplicates enabled returns six distinct integers, and both 1 and 49 are eligible. It does not sort the results or imply lottery odds.
Useful for
- Selecting numbered entries in a small draw
- Creating integer test data
- Choosing a starting player or turn order number
- Producing classroom practice values
Important limitations
- The output is not a certified public draw or auditable lottery system
- Only integers are generated
- A fair process also requires a fair, documented way to assign people or items to numbers
Questions specific to this tool
Are the minimum and maximum included?
Yes. Both endpoints can be selected.
What does No duplicates mean?
A number can appear at most once in that result, which is sampling without replacement.
Is the generator cryptographically random?
It uses the browser's cryptographic random source, but the page does not provide an external audit trail or certification.
Reviewed by: UtilityTrove editorial team · Last reviewed: August 15, 2026 · Tool version 1.0.0