Random Number Generator
Generate one or more random integers or fixed-decimal numbers within your chosen inclusive range.
How the random number generator works
The calculator uses the browser’s crypto.getRandomValues() source. It constructs a uniformly distributed 53-bit integer and applies rejection sampling before mapping it to the requested range. Rejecting the incomplete remainder avoids the modulo bias created when the random space is not an exact multiple of the requested range.
For decimal results, the selected range is converted into equally spaced integer steps. With two decimal places, for example, 1.25 becomes 125 and 3.50 becomes 350. The same unbiased integer selection is then used before dividing by 100.
When “Do not repeat numbers” is selected, partial Fisher–Yates sampling chooses values without replacement and without constructing every number in a large range.
Checked examples
| Settings | Possible values | Notes |
|---|---|---|
| Integer, 1 to 6 | 1, 2, 3, 4, 5 or 6 | Both endpoints included |
| Integer, −3 to 3 | −3 through 3 | Seven possible integers |
| Integer, 10 to 10 | 10 | One-value range |
| Decimal, 0 to 1, 1 place | 0.0 through 1.0 | Eleven equally spaced values |
| Decimal, 1.25 to 1.30, 2 places | 1.25 through 1.30 | Six equally spaced values |
| Three unique integers, 1 to 3 | 1, 2 and 3 in random order | No repetition |
| Five integers, 1 to 100 | Five independently selected values | Repetition allowed unless disabled |
How to use the Random Number Generator
- Choose integers or decimals.
- Enter the inclusive minimum and maximum.
- Select how many numbers to generate.
- For decimals, choose 0–6 decimal places.
- Optionally prevent repeats or sort the results.
- Select Generate random numbers for a new result.
Limits and appropriate use
- You can generate 1–1,000 values at a time.
- Integer endpoints are limited to ±1,000,000,000,000. Decimal endpoints are limited to ±1,000,000 with up to six decimal places.
- Unique generation fails clearly when the requested quantity exceeds the count of representable values.
- Every click produces a new browser-generated result. There is no user-supplied seed or reproducible sequence.
- This tool is suitable for general selection, games, classroom exercises and simulations. It is not an audited lottery system and should not generate passwords, encryption keys or regulated gambling outcomes.
Frequently asked questions
Are the minimum and maximum included?
Yes. Both endpoints are possible whenever they are representable at the selected decimal precision.
How do I generate unique numbers?
Select “Do not repeat numbers.” The requested quantity must not exceed the number of available values in the range.
Can I generate negative numbers?
Yes. Enter a negative minimum, maximum or both.
Why can decimal generation reject my range?
The selected precision must leave at least one representable value between the endpoints. For example, a very narrow interval may contain no value at two decimal places.
Is this the same as Math.random()?
No. The calculator uses the browser’s cryptographic random-value source and rejection sampling rather than directly scaling Math.random().
Related calculators
Use the Probability Calculator for event and binomial probabilities, the Average Calculator to summarize generated data, or the Standard Deviation Calculator to measure its spread.