Connect via MCP →

Enter Calculation

Formula

Advertisement

Results

Your Random Number
65
between 1 and 100
First number 65
Numbers generated 1
Possible values (range size) 100

What is a random number generator?

A random number generator (RNG) produces unpredictable numbers within limits you choose. This tool generates random integers between a minimum and a maximum value (both inclusive). You can draw a single number or many at once, and you can decide whether repeated values are allowed. It's handy for raffles and giveaways, picking lottery-style numbers, choosing a winner from a list, assigning teams, dice and game rolls, sampling, or any time you need an impartial pick.

How to use it

Enter the Minimum and Maximum of your range, set How many numbers you want (1–100), and choose whether to allow duplicates. If you turn duplicates off, the generator returns only distinct values — and if you ask for more numbers than the range can supply, it automatically caps the count to the number of available values.

The formula explained

For one integer the tool uses $$x_i = \text{Min} + \left\lfloor \text{rand}() \times \left( \text{Max} - \text{Min} + 1 \right) \right\rfloor$$ where \(\text{rand}()\) is a uniform fraction in [0, 1). Multiplying by the range size \(\left( \text{Max} - \text{Min} + 1 \right)\) and flooring gives an offset from 0 up to range−1, which is then added to \(\text{Min}\). This makes every integer in the inclusive interval equally likely. To draw several numbers the process simply repeats; when duplicates are disallowed, picked values are removed from the pool so they cannot recur.

Advertisement
Flat diagram of the random number formula mapping a 0-to-1 random value into an integer range
The formula maps rand() (0 to 1) onto the integer range and floors the result.
Diagram showing random selection of an integer from a range between min and max on a number line
A random number generator picks a value uniformly between the chosen min and max.

Worked example

Suppose you want 3 unique numbers between 1 and 6. The range size is $$6 - 1 + 1 = 6$$ The generator picks from {1,2,3,4,5,6}, removing each chosen value, so you might get 4, 1, 6 — three different numbers, never repeating. With duplicates allowed you could instead see something like 4, 4, 1.

FAQ

Are the numbers truly random? They are pseudo-random — generated by a software algorithm that is statistically uniform and more than sufficient for games, draws and everyday picks, but not for cryptography.

Are min and max included? Yes. Both endpoints can be produced; the interval is inclusive on both ends.

What if min is larger than max? The values are swapped automatically so the range still makes sense.

Last updated: