Random Number Generator
Choose a minimum, maximum and how many whole numbers you want, then generate a draw. Turn off repeated numbers for a shuffled set of picks, or allow repeats to simulate independent rolls.
Loading the calculator. It runs in your browser, so JavaScript needs to be on.
How to use the Random Number Generator
- Enter Minimum (inclusive) and Maximum (inclusive). Both endpoints can be drawn, and negative integers are allowed.
- Set How many numbers? to a whole number from 1 to 100.
- Keep No repeated numbers checked for a draw without replacement. Uncheck it if each result should be an independent draw from the full range.
- Press Generate numbers for another draw. Results stay in draw order, with a range summary underneath.
The formula
The number of available integers is maximum - minimum + 1. With repeats, each integer has probability 1 / range size on every draw. Without repeats, each draw is uniform among the remaining integers. Rejection sampling removes the bias that would come from directly reducing all 32-bit samples modulo the range size.
Worked example
For Minimum 1, Maximum 6 and How many numbers 3, there are 6 available integers. With repeats enabled, a result such as 1, 6, 1 is valid. With No repeated numbers checked, that repeated 1 cannot occur in the same draw; a result such as 1, 6, 5 is valid. These show permitted outcomes, not a prediction of the next draw.
The endpoints count
A range from 1 to 10 contains 10 integers, while 0 to 10 contains 11. To simulate a six-sided die, set the minimum to 1 and maximum to 6 and allow repeats. For a coin coded as 0 and 1, use those two endpoints. The tool accepts bounds from -1 billion to 1 billion and generates whole numbers only.
No repeats changes the later draws
If you draw six numbers from 1 through 49 without replacement, the first has 49 possibilities and the last has 44. Each complete ordered draw has the same chance. Choosing more unique numbers than the range contains is impossible, so the calculator asks you to reduce the count or allow repeats. No repeats applies within one draw, not across later presses of Generate.
Where the randomness comes from
Supported browsers use crypto.getRandomValues for unsigned 32-bit random samples. Rejection sampling keeps the integer mapping uniform, and draws without replacement use a partial shuffle. If that browser feature is unavailable, the result note discloses a Math.random fallback. This page is useful for games, classroom picks and casual sampling; it does not provide an auditable drawing record or a lottery prediction.
Random Number Generator questions
Are both the minimum and maximum included?
Yes. A draw from 1 through 6 can return either 1 or 6, along with the integers between them.
Can I generate random numbers without duplicates?
Yes. Check No repeated numbers and request no more integers than the range contains.
Why did the same number appear twice?
Independent draws can repeat when repeats are allowed. Even with no repeats within a set, the same number may appear in a later generated set.
Can this predict lottery numbers?
No. A fair random draw cannot predict a future independent lottery drawing. Every valid combination still has its original probability.
Related calculators
- Probability CalculatorEnter two event probabilities to find the chance of both, either, exactly one or neither....
- Mean, Median, Mode CalculatorPaste a list of numbers to find the mean, median, modes, sum and range. Repeated values...
- Sample Size CalculatorEnter confidence, margin of error and an expected proportion or standard deviation to...
- Binary CalculatorEnter two binary numbers to add, subtract, multiply or divide. See signed binary results,...