Random Number Generator

The random number generator creates truly unpredictable numbers within any range you define. Whether you need one number or hundreds — for lotteries, board games, statistical sampling, classroom activities, or coding tests — this free tool delivers instant, unbiased results.

What this calculator does

Choose your minimum and maximum values, set how many numbers to generate, and optionally enable 'unique' mode to prevent repetition. Unique mode is essential for lottery draws — every number appears only once.

Formula

Random Integer Formula

Random Int = Math.floor(Math.random() × (max − min + 1)) + min

Generates a uniformly distributed integer in the range [min, max]. For unique numbers, each result is removed from the pool before the next is drawn.

Worked example

Pick 6 unique lottery numbers between 1 and 49.

  1. Set min = 1, max = 49, count = 6, unique = ON
  2. Click Generate

Result: Example output: 3, 17, 22, 31, 43, 48 (uniformly random, no repeats)

Frequently asked questions

Are the numbers truly random?

They use JavaScript's Math.random() which generates pseudo-random numbers — statistically uniform and sufficient for all practical purposes except cryptographic security.

Can I generate unique lottery numbers?

Yes. Enable the 'unique' option and set count to 6, range 1–49 for UK Lotto, or 1–70 for Mega Millions main numbers.