Random Number Generator
Generate random numbers, unique sequences, dice rolls, coin flips, and random lists. Supports custom ranges, decimals, and reproducible seeds.
Up to 10,000 numbers at once.
Use the same seed + settings to reproduce the same sequence.
How this random number generator works
This tool runs entirely in your browser and uses a high‑quality pseudo‑random number generator (PRNG) with optional seeding. That means:
- Fresh randomness when you leave the seed blank (seeded from current time and browser entropy).
- Reproducible sequences when you provide a seed (same seed + settings → same results).
- No data is sent to a server for the actual randomization; everything is computed locally.
Uniform distribution on a range
For integers between a minimum \(a\) and maximum \(b\) (inclusive), we first generate a uniform pseudo‑random value \(u\) in the interval \([0,1)\), then map it to the range:
n = a + floor(u × (b - a + 1))
This ensures each integer in \([a, b]\) has (approximately) equal probability, assuming the underlying PRNG is uniform.
Unique numbers and shuffling
When you enable Unique (no repeats), the generator:
- Builds the full list of possible values in the range.
- Shuffles the list using the Fisher–Yates algorithm.
- Takes the first k values, where k is the quantity you requested.
Fisher–Yates shuffling visits each position once and swaps it with a random later position, producing an unbiased permutation when driven by a uniform PRNG.
Seeds and reproducibility
A seed is just a starting value for the PRNG. With the same seed and algorithm, the sequence of generated numbers is completely determined. This is useful for:
- Teaching and demonstrations where students must reproduce your examples.
- Debugging simulations and Monte Carlo experiments.
- Sharing exact random samples with colleagues.
If you leave the seed blank, the tool derives one from the current timestamp and other browser‑side entropy so that each session behaves differently.
Common use cases
- Statistics & data science – sampling, bootstrapping, randomization tests.
- Education – generating practice problems, random quiz versions, or seating charts.
- Games & tabletop RPGs – dice rolls, loot tables, random encounters.
- Everyday decisions – picking a winner, choosing a restaurant, shuffling a to‑do list.
Limitations and safety notes
- This is a pseudo‑random generator, not a hardware or quantum RNG.
- Do not use it for passwords, encryption keys, or any security‑critical purpose.
- For cryptographic randomness, use dedicated libraries or operating‑system APIs designed for that purpose.
FAQ
Can I generate negative random numbers?
Yes. You can set the minimum to a negative value (for example, −10) and the maximum to a positive value (for example, 10). The generator will then produce numbers uniformly across that range.
Why can’t I request more unique numbers than the range allows?
If your range has \(N = b - a + 1\) possible integers, you cannot draw more than \(N\) unique values. The tool checks this and shows an error if you request too many unique numbers.
How are decimals generated?
For decimals, we generate a uniform real value in \([a, b)\) and then round it to the number of decimal places you specify. This is suitable for simulations and everyday use, but note that floating‑point rounding can introduce tiny numerical artifacts.