About this tool
Generate one or many random integers within any range, with an option to forbid duplicates — ideal for raffle draws, lottery-style picks and random sampling. Numbers come from the Web Crypto API with rejection sampling, so every value in the range is exactly equally likely.
Naive generators using Math.random() with modulo introduce subtle bias toward lower numbers and are predictable enough to be unsuitable for anything adversarial. For a fair draw, the randomness source and the unbiased mapping both matter; this tool gets both right.
How to use it
- Set the minimum and maximum of the range (inclusive).
- Choose how many numbers and whether duplicates are allowed.
- Click Generate — rerun for a fresh draw.
Frequently asked questions
Are these numbers truly random?
They are cryptographically secure pseudorandom — unpredictable in practice and drawn uniformly. True hardware randomness is indistinguishable for any normal purpose.
Can I use this for a prize draw?
Yes — unique mode guarantees no repeated winners, and uniform sampling guarantees fairness. Record the draw settings for transparency.
Why does modulo bias matter?
Mapping a random 32-bit value into a range with % slightly favors smaller results unless the range divides evenly. Rejection sampling, used here, eliminates that bias.