HOME / MISCELLANEOUS & FUN / ENTERTAINMENT / RANDOM NUMBER GENERATOR
Miscellaneous & Fun / Entertainment

Random Number Generator

Repeats

Order

Numbers come from your browser's cryptographically secure generator (crypto.getRandomValues), with no bias toward any value, and are generated on your device. For official draws, use a process your rules require and record it.

Generate random whole numbers in any range, one or many at a time, with or without repeats and sorted or in the order drawn, using your browser's cryptographically secure random generator. Presets cover 1–10, 1–100, a 6-of-49 lottery draw and a coin flip.

Formula

Each number is uniform on[min,max]:P(any value)=1÷(max−min+1)\text{Each number is uniform on} [\text{min}, \text{max}]: \text{P}(\text{any value}) = 1 \div (\text{max} - \text{min} + 1)
without repeats,drawing k of N gives C(N,k)=N!÷(k!(N−k)!)possible sets\text{without repeats}, \text{drawing k of N gives C}(\text{N}, \text{k}) = \text{N}! \div (\text{k}! (\text{N} - \text{k})!) \text{possible sets}

Worked Example

Range1 to 49
How many6
RepeatsNot allowed
OrderSorted
Result
Example draw6 different numbers such as 3, 11, 24, 30, 38, 47
Possible sets13,983,816

Without repeats there are C(49, 6) = 13,983,816 possible sets, each equally likely, so any particular ticket has a 1 in 13,983,816 chance of matching all six.

Frequently Asked Questions

Are the numbers truly random?

They come from crypto.getRandomValues, the cryptographically secure generator built into browsers, and are mapped to your range without bias. They are unpredictable for practical purposes, though, like all computer generators, they are not drawn from a physical process.

How do I pick a random winner from a list?

Number the entries from 1 to N and generate one number in that range. To pick several winners, set how many you need and turn off repeats so no entry wins twice.

Can this be used for an official lottery or giveaway?

For informal draws, yes. Official lotteries, sweepstakes and regulated contests usually require a documented, auditable process, so follow the rules that apply to yours and record how the draw was made.