Random Number Generator

Generate random numbers within any custom min-to-max range. Choose integers or decimals, set the count, and allow duplicates or unique sets, using crypto-grade randomness.

Number Type
Allow Duplicates

How to Use

  1. Set the range

    Enter the minimum and maximum values for your random numbers.

  2. Configure options

    Set how many numbers to generate, choose integer or decimal, and enable or disable duplicates.

  3. Generate

    Click Generate to instantly produce random numbers matching your settings.

What is a random number generator?

A random number generator is a tool that picks numbers within a chosen range in a way that no one can predict or deliberately influence. You set a 'minimum to maximum' interval, decide how many numbers to draw and whether the same value may appear again (allow duplicates or no repeats), and a list of numbers matching your conditions appears instantly.

Where is it used?

  • Draws and giveaways: Remove human bias from situations where fairness matters, such as choosing prize winners, presentation order, or team assignments.
  • Lottery and number picking: Use it to draw numbers under specific rules, like 6 unique numbers from 1 to 45.
  • Simulation and sampling: Handy for dice and coin simulations, random sampling of survey respondents, or splitting groups for A/B testing.

This tool uses the browser's crypto.getRandomValues() to produce high-quality random numbers based on operating-system entropy, and removes bias that would break a uniform distribution.

Calculation formula

A single integer drawn from the range [min, max] is computed as follows.

result = min + ⌊ r × (max − min + 1) ⌋

  • min / max: the minimum and maximum of the range (both inclusive)
  • r: a uniform random number from 0 up to (but not including) 1
  • max − min + 1: the total count of possible integers (= range)

Example: with min=1, max=45 and r=0.732,
1 + ⌊0.732 × 45⌋ = 1 + ⌊32.94⌋ = 1 + 32 = 33

For no repeats, if an already-drawn value comes up again it is discarded and re-drawn (rejection sampling). So count ≤ range must hold; from 1 to 45 you can generate at most 45 unique numbers.

Frequently Asked Questions

Is this random number generator truly random?
It uses the browser's crypto.getRandomValues() API to generate cryptographically secure random numbers based on operating-system entropy. The randomness is far higher than Math.random(), and the results are practically impossible to predict.
What is the difference between Math.random() and crypto.getRandomValues()?
Math.random() is a pseudo-random function: if you know the internal seed, you can reproduce and predict the sequence. By contrast, crypto.getRandomValues() is a CSPRNG that draws on OS entropy sources, so it cannot be predicted. When fairness and security matter, as in a prize draw, you should use the latter.
Can I generate random numbers without duplicates?
Yes, just select 'No duplicates'. It uses rejection sampling, where any number that matches one already drawn is discarded and replaced, so no value appears twice in the result.
Why do I get the error 'cannot generate N numbers without duplicates'?
To draw without duplicates, the requested count cannot exceed the number of values in the range (range = max − min + 1). For example, 15 unique numbers from 1 to 10 is impossible. Widen the range or reduce the count.
How do I set it up to pick lottery numbers?
Set minimum 1, maximum 45, count 6, and duplicates to 'No duplicates', and you get numbers under the same conditions as the Korean lottery (6/45). To also see a bonus number, raise the count to 7. This is for reference only and does not guarantee a win.
Can it generate decimal (real-number) random values?
Yes, switch the number type to 'Decimal' to generate real numbers within the range, and you can specify the number of decimal places you want. This is useful when you need continuous values such as a probability between 0 and 1, or coordinates.
Isn't there bias in the random numbers?
If you simply take the remainder of a random number divided by the range (modulo), modulo bias appears and certain numbers come up more often. This tool removes that bias using rejection sampling, which discards values above the largest multiple of the range, so every value has an equal probability.
Can I reproduce the same result again (seed)?
No. This generator creates numbers from fresh entropy every time, without a seed, so the same sequence cannot be reproduced on purpose. It suits one-off fair draws; for experiments that need reproducibility, use a separate seed-based tool.
Verified 2026 formulas

Related Calculators