Quick examples
- Roll a die: minimum 1, maximum 6, how many 1.
- Lottery numbers: for example minimum 1, maximum 49, how many 6, no duplicates, sorted.
- Pick a winner: number your entries, then pick one number between 1 and the number of entries.
- Coin flip: 1 to 2, where 1 is heads and 2 is tails.
Is it really random?
The numbers come from crypto.getRandomValues, the cryptographically secure random generator in your browser, and every number in the range has exactly the same chance.