Skip to main content
Calculator WorldProFree online calculators

Random Number Generator

Pick a random number, or a whole list of them, between any two values. Choose whole numbers or decimals, allow or prevent repeats, and sort the results if you like.

Number type

Result

Choose your options and press Generate.

How to use the Random Number Generator

  1. Set the minimum and maximum. Both limits are included for whole numbers.
  2. Choose how many numbers you want and whether repeats are allowed.
  3. Press Generate. Press it again for a fresh set.

Formula

Whole number: min + ⌊u × (max − min + 1)⌋
Decimal: min + u × (max − min)
where u is uniform in [0, 1)

Each number is drawn from a uniform distribution, so every value in the range is equally likely. Unique draws reject any number that has already appeared.

Worked example: Six unique lottery-style numbers from 1–49

  1. Min 1, max 49, count 6
  2. Untick “Allow repeated numbers”
  3. Tick “Sort results”

Six distinct numbers in ascending order, for example 4, 11, 23, 30, 38, 47.

Fair picks and sampling

Random selection removes bias when choosing a winner, assigning teams, sampling survey respondents or shuffling a playlist. For fair raffles, number every entry, generate one number without repeats, and note the time you generated it.

To analyse a set of numbers once you have it, the Average Calculator and Standard Deviation Calculator can help.

Assumptions & limitations

  • Randomness comes from the Web Crypto API (crypto.getRandomValues) where available.
  • Without repeats, you can't request more numbers than the range contains.
  • Not intended for regulated gambling, official lotteries or generating security keys.

Frequently asked questions

Is this truly random?

It uses a cryptographically secure pseudo-random generator supplied by your browser, which is unpredictable for all practical purposes and much stronger than Math.random.

Can I simulate dice?

Yes. For one six-sided die use min 1 and max 6. For several dice, set the count and allow repeats.

Are the minimum and maximum included?

For whole numbers, yes, both ends are possible. For decimals, the minimum is possible and the maximum is approached but practically never reached exactly.