Random Number Generator

Generate one or many random numbers within a custom range. Choose whole numbers or decimals, allow or exclude duplicates, and generate up to 1000 numbers at once — useful for raffles, games, sampling, and quick simulations. Everything runs instantly in your browser.

Numbers are generated instantly in your browser using a uniform random distribution — nothing is sent to a server.

Who should use it: Anyone running raffles, games, sampling, or quick simulations.

How to use this calculator

  1. 1Enter the minimum and maximum values for your range.
  2. 2Enter how many numbers you want to generate (up to 1000).
  3. 3Choose whether to allow whole numbers only and whether to allow duplicates.
  4. 4Press Generate Numbers and review the results, plus the sum, average, and smallest value drawn.

Understanding the inputs

MinimumThe lower bound of the range. Must be less than the maximum.
MaximumThe upper bound of the range. Must be greater than the minimum.
How many numbers?The count of random numbers to generate, from 1 to 1000.
Whole numbers onlyWhen checked, only whole numbers within the range are generated. When unchecked, decimal values are produced.
No duplicatesWhen checked, every generated number is unique. The range must be large enough to fit the requested count.

How the calculation works

Each number is produced by JavaScript's Math.random(), which returns a uniformly distributed value between 0 (inclusive) and 1 (exclusive). For decimal output, the calculator scales that value to your range, so the result can be any value from the minimum up to but not including the maximum. For whole-number output, the calculator maps the random value onto the whole numbers from the rounded minimum up to and including the rounded maximum, so both endpoints can appear. When "No duplicates" is on, already-drawn values are skipped until the requested count of unique values is reached.

Decimal: random × (max − min) + min; Whole: floor(random × (floor(max) − ceil(min) + 1)) + ceil(min)

Worked example

Scenario: Generate 5 whole numbers between 1 and 100 with duplicates allowed.

Result: Five whole numbers from 1 to 100 (inclusive), such as 42, 7, 91, 23, 58, plus their sum, average, and smallest value.

How to interpret your result

The results are random values drawn uniformly from your chosen range. With whole numbers, both the minimum and maximum can appear. With decimals, values can be anywhere from the minimum up to just below the maximum. The sum, average, and smallest-value figures help you check the spread of a batch. Each press of Generate produces a fresh, independent set of numbers.

Factors that can affect the result

  • Range size: a wider range gives more possible values; a narrow range with "No duplicates" may not have enough unique values for the count you request.
  • Whole vs decimal: whole-number mode is inclusive of both endpoints; decimal mode can reach the minimum but not the maximum.
  • Duplicates: allowing duplicates means the same value can appear more than once; excluding duplicates requires a range large enough to supply the requested count.

Limitations and assumptions

  • Uses Math.random(), a pseudo-random number generator that is not cryptographically secure. Do not use it for security-sensitive purposes such as generating passwords or tokens.
  • Decimal output can reach the minimum but not the maximum, because Math.random() never returns exactly 1.
  • With "No duplicates" and whole numbers, the count cannot exceed the number of whole numbers in the range; the calculator warns if you ask for more.

Frequently asked questions

Related calculators

Methodology

The generator uses JavaScript's Math.random() to produce uniformly distributed values, scaled to your range for decimal output or mapped onto whole numbers (inclusive of both endpoints) for whole-number output. It is a pseudo-random source and is not cryptographically secure.

Sources and references

  • Mathematical basis — uniform pseudo-random generation via Math.random() follows the ECMAScript specification; it is not a cryptographic random source
Last reviewed: August 2026. Read our editorial policy.

Disclaimer: Results are provided for informational purposes and may vary depending on the values entered, the assumptions described above, and rounding. They are not a substitute for professional advice specific to your situation. Read the full disclaimer.