Random Number Generator

Generate random whole numbers in a range, with or without duplicates.

What the Random Number Generator does

Generates uniformly distributed whole numbers between your bounds, inclusive of both ends. Choose unique draws for raffles and team picking, or allow repeats to simulate dice and coin flips.

Formula

  • value = min + ⌊random() × (max − min + 1)⌋

Inputs explained

InputUnitRequiredNotes
MinimumnumberYes
MaximumnumberYes
How many numbersnumberYesAccepts 1 or more, up to 1000.
Allow repeats?one of 2 optionsYes

How to use it

  1. Choose Allow repeats?.
  2. Enter Minimum, Maximum and How many numbers.
  3. Select Calculate.

Worked example

Pick 6 lottery numbers from 1 to 49 with no repeats.

Minimum
1
Maximum
49
How many
6
Repeats
No repeats

Six distinct numbers such as 4, 11, 23, 30, 38, 45.

Reading the result

  • Both bounds are included, so a range of 1 to 6 can return either 1 or 6.
  • Unique draws suit raffles and team selection; allowing repeats models dice and coin flips, where every roll is independent.

Assumptions and limitations

  • Numbers come from the browser’s pseudo-random generator. That is fine for games, sampling and picking a winner, but it is not suitable for cryptographic keys or anything where predictability would matter.

Common mistakes

  • Expecting an even spread in a small sample. Genuine randomness clusters, and runs of repeats are normal.
  • Requesting more unique numbers than the range contains, which cannot be satisfied.

Frequently asked questions

Is this truly random?

It is pseudorandom — statistically uniform and fine for games, picking and sampling, but not for keys, passwords or anything security-related.

Are the endpoints included?

Yes. Both the minimum and maximum can be drawn.

Related calculators