Random Number Generator

Any range, any count, uniform distribution. Both ends included.

—
Options

Set a lower and upper bound and generate. The result is uniform: every integer in the range has the same probability, including both endpoints — a detail many generators get wrong by stopping one short of the maximum.

For more than one value, set the count. With no-repeats on, the tool samples without replacement, which is what you want for raffle draws, seat allocation and anything where the same number twice would be an error.

How to use it

  1. Enter a minimum and maximum.
  2. Set the count if you need several values.
  3. Turn on no-repeats when duplicates would be a bug rather than a coincidence.

Why this is not just Math.random() times a range

The obvious formula — Math.floor(Math.random() * (max - min + 1)) + min — has two problems. It uses a predictable PRNG, and floating-point multiplication can make the top value slightly less likely. Neither is visible in casual use, both are real.

This implementation draws 32-bit values from crypto.getRandomValues(), rejects anything outside the largest usable multiple of the range size, and only then maps to your bounds. That removes both the predictability and the bias, at the cost of occasionally re-drawing a value.

Reviewed 2026-10-21. This tool runs entirely in your browser — no server, no account, and nothing you generate is stored.

Frequently asked questions

Is the distribution really uniform?

Yes for integers. Each value in the range has an identical probability by construction. Small samples look uneven — that is variance, not bias.

Can I get decimals?

Set the decimal places above zero. The implementation scales to integers and divides back, which avoids the rounding drift that floating-point multiplication introduces.

Can I use this for a lottery or giveaway?

For a casual draw, yes. For anything with legal weight, document the method and the seed beforehand — reproducibility matters more than the algorithm there.

Are the results cryptographically secure?

The random source is. That said, this page is a utility, not a gambling service: do not use it to generate keys or tokens. Use the password generator for that.

Related tools

More from Random numbers.