How to generate random numbers
- Enter the minimum and maximum. Both are included: 1 to 10 can return 1 or 10.
- Set how many numbers you want (up to 10,000).
- Tick No repeats if every number must be different, like raffle tickets or lottery balls.
- Optionally choose decimal places and a sort order, then press Generate.
- Copy the result, or download it as a text file with one number per line.
The presets cover the common cases in one click: 1-10, 1-100, a six-sided die, 4- and 6-digit codes, and 6 numbers from 49.
Is this random number generator truly random?
It uses crypto.getRandomValues(), the same cryptographically secure random source browsers use to create encryption keys.
It is seeded from your operating system’s entropy (hardware timings and noise), so results can’t be predicted or reproduced, unlike
Math.random(), which is a fast pseudo-random generator not meant for anything that has to be fair.
Just as important, the range is unbiased. The common shortcut random % 6 makes low numbers slightly more
likely whenever the range doesn’t divide the generator’s output evenly. This tool uses rejection sampling: draws that fall in
the uneven remainder are discarded and drawn again, so every number in your range has exactly the same probability.
Random numbers without repeats
With No repeats on, each number appears at most once, the digital version of drawing numbered balls from a bag. You can’t ask for more unique numbers than the range contains: 1 to 49 has 49 values, so 50 unique numbers is impossible and the tool says so. To shuffle a whole range, set the count equal to the range size (for example 1-30 with 30 numbers).
Random decimal numbers
Choose 1-4 decimal places to get values like 3.7 or 0.0425. Decimals are generated on an even grid (0.00, 0.01, … 1.00 for two places), so they are just as uniform as whole numbers.
Common uses
- Giveaways and raffles: number the entries, then draw winners with no repeats.
- Games: dice rolls, bingo calls, picking who goes first.
- Classrooms: random question numbers, groups and seating.
- Sampling and testing: random row numbers to audit, IDs to spot-check, or test data for forms.
- PINs and codes: 4- or 6-digit numbers. For passwords, use the Password Generator.
Odds and fairness
Because every value is equally likely, the chance of any particular number is simply 1 divided by the size of the range: 1 in 6 for a die, 1 in 100 for 1-100, 1 in 9,000 for a 4-digit number (1000-9999). For a draw without repeats, the chance that a given entry is among k winners out of n entries is k ÷ n: 3 winners from 120 entries gives each entry a 2.5% chance.
Streaks are normal. Rolling the same number twice in a row happens one time in six, and in a list of 23 random birthdays there’s a better than even chance two match. If a result “doesn’t look random”, that usually means it is: truly random sequences contain more repeats and clusters than people expect.
For a public giveaway, record your settings and take a screenshot of the result with the time visible. The draw happens on your device, so anyone can run the same tool to see how it works.
Generating random numbers in code
// JavaScript: unbiased integer in [min, max]
function randomInt(min, max) {
const range = max - min + 1;
const limit = 2 ** 32 - (2 ** 32 % range);
let x;
do x = crypto.getRandomValues(new Uint32Array(1))[0];
while (x >= limit);
return min + (x % range);
} # Python: secure random integer in [min, max]
import secrets
n = secrets.randbelow(max - min + 1) + min FAQ
Are the minimum and maximum included?
Yes, both ends are inclusive.
Can I generate negative numbers?
Yes, set a negative minimum, for example −50 to 50.
Is anything sent to a server?
No. Numbers are generated in your browser and never leave your device, so draws can’t be seen or influenced by anyone else.
Can I get the same numbers again?
No, secure randomness can’t be replayed. Copy or download the results if you need to keep them.