Skip to content
Utilboxes

Random Number Generator

Generate random whole numbers in any range — one at a time, or a whole set with duplicates ruled out.

Runs entirely in your browser

How to use the Random Number Generator

  1. 1Set the lowest and highest numbers in your range.
  2. 2Choose how many numbers you want.
  3. 3Turn off duplicates if each number must be unique, as for a lottery draw.
  4. 4Generate, then copy the results.

How it works

Numbers come from crypto.getRandomValues(), the same cryptographic source used for passwords, rather than Math.random(). For a raffle or a decision that matters, that difference is worth having.

Getting a uniform distribution from random bytes takes a little care. Simply taking the remainder of a random number leaves the lower part of the range very slightly more likely — imperceptible for small ranges, but a real bias. Rejection sampling avoids it by discarding values that fall outside a clean multiple of the range.

With duplicates disabled, the tool draws without replacement, which is what a lottery or a prize draw actually does. It also checks that the range is large enough to supply the count you asked for.

Frequently asked questions

Is this truly random?
It uses the browser's cryptographically secure generator, seeded from operating system entropy. It is not quantum randomness, but it is unpredictable by any practical means.
Can I stop numbers repeating?
Yes. Turn off duplicates and the numbers are drawn without replacement, exactly as in a lottery draw.
Can I use this for a prize draw?
The randomness is sound. For anything with legal or contractual weight, keep a record of the entrant list and the result, since the draw itself leaves no audit trail.
Are the endpoints included?
Yes. Both the minimum and the maximum can be drawn.