The short answer
A random number generator produces values that appear unpredictable within a chosen range. This tool uses a pseudorandom algorithm — deterministic under the hood, but statistically indistinguishable from true randomness for everyday use like games, samples, and raffles. Set a minimum, maximum, count, and number type (integer or decimal), and each draw is selected with equal probability across the range.
Key takeaways
- Pseudorandom generators are fine for games, simulations, and casual selection, but not for cryptographic security, which needs true or cryptographically secure randomness.
- Excluding specific numbers removes them from the pool entirely — the remaining numbers still each have an equal chance of being drawn.
- Over many draws, a uniform generator's numbers should average out toward the middle of the range — the count and range determine how close any one batch lands to that average.
- Sampling with or without repetition are different modes — without repetition removes each number from the pool once drawn, which matters as the count approaches the size of the range.
Pseudorandom vs. true random
| Type | Source | Good for |
|---|---|---|
| Pseudorandom | Deterministic algorithm | Games, simulations, sampling, teaching |
| True random | Physical entropy (atmospheric noise, radioactive decay) | Cryptographic keys, security-critical draws |
Choosing between integers and decimals
Use integers for anything counted in whole units — dice rolls, lottery numbers, picking a winning ticket number, assigning team order. Use decimals when simulating continuous measurements — heights, weights, sensor readings, or any statistical sampling exercise where values naturally fall between whole numbers.
Worked example: expected mean of a range
Expected mean = (min + max) / 2
Range 1 to 10 → expected mean = (1 + 10) / 2 = 5.5
A batch of just a few random draws from 1-10 won't necessarily average exactly 5.5 — small samples can easily skew high or low by chance. Generate hundreds or thousands of numbers instead, and the average will drift steadily closer to 5.5, a direct illustration of the law of large numbers.
Common mistakes to avoid
- Expecting a small batch of random numbers to look "evenly spread" — genuine randomness often produces clumps and streaks; a suspiciously even spread can actually signal a non-random pattern.
- Excluding more numbers than the range can support for a unique draw — you can't request more unique values than remain after exclusions.
- Using pseudorandom output for cryptographic keys or password generation — that requires a cryptographically secure random source instead.
- Overlooking decimal precision when generating decimal values, which can make results look artificially "clean" for what's meant to simulate a continuous measurement.
Related calculators
- Statistics Calculator — analyze the spread and distribution of a generated batch.
- Average Calculator — check how close a batch's mean landed to the expected value.
- Standard Deviation Calculator — measure how spread out a random sample turned out to be.
- Sample Size Calculator — decide how many random draws a study or simulation actually needs.