Random Number Generator
Generate cryptographically strong random numbers in any range, with or without repeats.
About Random Number Generator
This picks a uniformly random whole number between your minimum and maximum, inclusive of both ends. Change the minimum, maximum, or the re-roll field to draw a new number.
Formula
Uniform integer in [min, max]
r = floor( random() × (max − min + 1) ) + min
- random()
- Pseudo-random float uniformly drawn from [0, 1)
- min
- Inclusive lower bound
- max
- Inclusive upper bound
- r
- The resulting random integer
Worked example
With the default values below, Random Number Generator returns Random Number of 3. Change any input above and every figure here is recalculated in your browser.
Inputs used
- Minimumaccepts -1,000,000–1,000,000
- 1
- Maximumaccepts -1,000,000–1,000,000
- 100
- Re-roll (change to draw again)accepts 0–999,999
- 0
Results
- Random Number
- 3
- Range Low
- 1
- Range High
- 100
Step by step
- 1Determine the range= 100 possible integers
- 2Draw a uniform pseudo-random float from [0, 1)Uses the browser's built-in Math.random() — cryptographically unpredictable for all practical purposes.
- 3Scale, floor, and shift into the target rangeEach integer in the range is equally likely.
- 4Result= 3
Assumptions and limits
- The result is derived only from the 3 inputs listed above. Anything not among them is not part of the calculation.
- In particular, this calculator does not take inflation, tax, fees or charges or compounding frequency into account.
- Figures are rounded for display to whole numbers, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.
How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.
Frequently Asked Questions
Is this truly random?
It uses your browser's built-in pseudo-random generator, which is statistically random and perfect for games, giveaways, and everyday picks — but not for cryptographic security.
How do I get a new number?
Adjust any input, including the dedicated re-roll field, and a fresh random number is generated instantly.
