Table of Contents
What Is a Random Number Generator?
A Random Number Generator (RNG) produces numbers that lack any predictable pattern. There are two types: true random number generators (TRNGs), which use physical phenomena like atmospheric noise, and pseudorandom number generators (PRNGs), which use mathematical algorithms to produce sequences that appear random.
This calculator uses a PRNG (JavaScript's Math.random()) which is suitable for general-purpose randomization tasks like games, simulations, and sampling. For cryptographic purposes, more secure generators like the Web Crypto API should be used.
How It Works
Decimal: random() × (max - min) + min
For integers, the formula ensures each value from min to max (inclusive) has an equal probability of being selected. For decimals, the result is a continuous uniform random variable in the interval [min, max).
Common Uses
| Use Case | Example |
|---|---|
| Lottery / Drawing | Pick random winners from a list |
| Gaming | Generate random events or loot |
| Statistics | Random sampling from a population |
| Education | Probability experiments |
| Decision Making | Random selection when choices are equal |
Frequently Asked Questions
Are the numbers truly random?
This tool uses a pseudorandom number generator (PRNG), which produces numbers that are statistically random for practical purposes. They pass standard randomness tests and are suitable for most non-cryptographic applications.
Can I generate numbers with no repeats?
This generator may produce duplicates when generating multiple numbers. If you need unique numbers, generate more than you need and remove duplicates, or use a shuffle algorithm on the full range.