Crypto random · uniform across the range

Random Number Generator

Pick a minimum, a maximum, and how many numbers you need — for raffles, dice, test data or classroom games. Results are drawn from your browser's cryptographic source with rejection sampling, which keeps every number in the range equally likely.

Why Math.random() ranges can be unfair

The usual one-liner min + Math.floor(Math.random()*(max-min+1)) has two problems. First, Math.random() in many languages is a fast generator, not a fair one for anything you care about. Second, mapping 32-bit draws with a modulo into an awkward range size (say 1–6) slightly favors low values unless you discard out-of-range draws — that discard step is called rejection sampling, and this page does it: a draw is thrown away if it lands in the uneven tail of the 2³² window.

The result is a uniform distribution you can use to pick a winner honestly. The seed, the draw sequence and the outcome never leave your machine — nobody, including us, can predict or replay your roll.

FAQ

How does "no duplicates" work?
We draw without replacement: once a number is used, the pool shrinks. If you ask for more numbers than the range holds, the page tells you instead of silently breaking.
Is this good enough for a real raffle?
Yes for transparency in one click: anyone can watch a draw happen with dev tools open and see no network traffic.
Can I get decimals?
This tool focuses on integers, which covers the common cases; for decimals, divide a large integer draw by 1000 mentally.

← All tools