How the numbers are picked
We draw from crypto.getRandomValues and use rejection sampling, which throws away the few raw values that would make some numbers slightly more likely than others. Every number in your range has the same chance.
With No repeats on, the numbers are drawn like tickets from a hat: once a number is picked it can’t come up again. That is what you want for raffles, seat assignments or picking winners.
Examples
- Pick a raffle winner: min 1, max = number of tickets sold, how many 1.
- Lottery-style draw: 6 numbers from 1 to 49, no repeats, sorted.
- Roll a die: 1 to 6 — or use the dice roller.
Frequently asked questions
Is this truly random?
It uses a cryptographically secure pseudo-random generator, which is unpredictable for all practical purposes, including drawings and games.
Can I generate negative numbers?
Yes, set a negative minimum.
Last reviewed 2026-10-14.