Random Number Generator
Generate one or many random integers within a custom range using a cryptographically secure RNG.
How it works
This generates random integers from a min to max range, inclusive on both ends. Use it for raffles, picking winners, randomized testing, dice rolls, or any time you need uniform random integers without the bias that simple Math.random() modulo can introduce.
The implementation uses crypto.getRandomValues (cryptographically secure pseudorandom number generator, CSPRNG). For small ranges, this is essentially uniform — the modulo bias is negligible. For very large ranges close to 2^32, modulo bias could cause some values to be slightly more likely than others, but for any practical use case (lottery numbers, dice, picking a person from a list of millions) it's irrelevant.
For one-off picks (raffle winner, pick-a-card), generate one number. For bulk needs (Monte Carlo, simulation), set the count up to 1000. The generator is fast — even 1000 numbers complete in microseconds.
Reproducibility note: this RNG is not seeded. You cannot reproduce a sequence by starting over. If you need reproducibility (testing random algorithms, statistical analysis), use a seeded PRNG like xoshiro or PCG with a recorded seed value.
For non-uniform distributions (normal, exponential, weighted picks), this calculator alone isn't enough — you'd need to transform uniform output. Box-Muller transforms two uniform [0,1] samples into two normal samples; rejection sampling handles arbitrary distributions; weighted picks can use cumulative probability and binary search.
Practical tip: for raffles or any high-stakes pick, do the draw publicly and recorded — show the calculator, show the seed (if any), show the result. "I picked it from a calculator on the internet" is more credible when the audience can repeat the steps.
Frequently asked questions
Is this truly random?▾
It uses a CSPRNG, which is cryptographically unpredictable. Not 'true' randomness from physical entropy, but indistinguishable for practical purposes.
Can I reproduce a result?▾
No — there's no seed. For reproducible randomness use a seeded PRNG library.