How the numbers are picked
To pick a whole number from min to max inclusive, scale a random fraction across the range:
This tool draws its randomness from crypto.getRandomValues, the browser's cryptographically strong generator, rather than the weaker Math.random. Each value in the range is equally likely. For unique draws it keeps picking until it has the requested count of distinct numbers.
Worked example
One number from 1 to 100:
Random vs secure random
For lottery picks, raffles, sampling or games, ordinary randomness is fine. When unpredictability really matters — passwords, tokens, cryptographic keys — you want a cryptographically secure source, which is what this generator uses. Note that "unique" mode needs the range to be at least as large as the count, or there aren't enough distinct values to draw.