Random Number Generator
Pick a range and how many numbers you need, then generate a fresh random sample every time you change an input.
What this tool does
Pick a minimum, a maximum, how many numbers you need and how many decimal places to keep, and the tool draws that many random values in one shot. With the defaults it draws 5 integers between 1 and 100, refreshing the sample every time you edit an input. Typical jobs range from a single dice roll (1 to 6) to a quick 20-value test dataset.
How the randomness works
Every number is drawn independently from a uniform distribution over your chosen range, so every value between the minimum and maximum has the same chance of being picked. The generator uses your browser’s built-in pseudo-random source — good enough for games, raffles, sampling and prototyping. Nothing is stored or transmitted; each draw happens locally and instantly.
Integers vs decimals
Set Decimal places to 0 for whole numbers, or 1–3 for fractional values. With 0 decimals the maximum is included; with decimals each draw is rounded to your chosen precision. If you enter a minimum larger than the maximum, the tool swaps them automatically rather than returning an empty result.
Drawing a fresh sample
The output recalculates on every input change, so nudging the minimum by 1 re-rolls the whole list. That behavior doubles as a re-roll button: change any value and change it back to pull a new sample without touching anything else.
What to expect statistically
Uniform draws have predictable long-run behavior even though any single draw is unpredictable. The average of all values in the range 1–100 is (1 + 100) ÷ 2 = 50.5, so the mean of your 5 draws will usually land near 50.5, with typical samples ranging from the 30s to the 70s. Values cluster nowhere in particular — that is the point of uniformity. The spread of individual draws is also predictable: for a uniform range of width 99, the standard deviation is about 99 ÷ √12 ≈ 28.6, so most single draws fall within roughly 29 of 50.5.
Duplicates are more likely than most people expect. Drawing 5 integers from 1–100 produces a repeat about 9.65% of the time, because the probability that all 5 are distinct is (100 ÷ 100) × (99 ÷ 100) × (98 ÷ 100) × (97 ÷ 100) × (96 ÷ 100) ≈ 0.9035. Raise the count to 20 draws from the same range and at least one duplicate becomes roughly 85% likely. Duplicates are a feature of independent draws, not a bug.
Typical uses
| Use case | Suggested range | Decimal places |
|---|---|---|
| Dice roll (d6) | 1 to 6 | 0 |
| Raffle winner among 500 entries | 1 to 500 | 0 |
| Random prices for test data | 1 to 100 | 2 |
| Signed simulation noise | −50 to 50 | 1 |
| Picking 20 respondents from a numbered list | 1 to N | 0 |
For picking people from a list, number the entries first and draw exactly as many values as you need picks; if repeats are unacceptable, draw one at a time and redraw any duplicate. For simulation inputs, signed ranges such as −50 to 50 with 1 decimal place give symmetric noise around zero.
Pseudo-random vs truly random
Almost all software random generators are pseudo-random — they start from a hidden seed and produce a sequence that passes statistical tests for randomness but is technically reproducible if the seed were known. For casual use this is indistinguishable from true randomness: values come out uniform, independent and uncorrelated in practice. For security-sensitive jobs — passwords, cryptographic keys, regulated lottery draws — use a cryptographically secure generator instead, because reproducibility is a vulnerability there.
- Use integers for dice, raffles and picking people from a numbered list.
- Use 1–2 decimal places for prices, measurements and test data.
- Draw 10–20 numbers at once when you need a quick sample.
Common mistakes
- Assuming no repeats — independent draws repeat often, about 9.65% of the time for 5 draws from 1–100
- Using the output for passwords, keys or regulated draws, where a secure generator is required
- Expecting small samples to look evenly spread — 5 draws from 1–100 can legitimately cluster in one region
- Entering the range backwards, which the tool silently swaps rather than rejecting
- Reading meaning into a single sample; rerun the draw a few times before drawing conclusions from the pattern
A fair dice check illustrates the last point: over 6 rolls of a range from 1 to 6, seeing no 6 at all happens with probability (5 ÷ 6)6 ≈ 33.5%, about one time in three. Absence of a value in a small sample is normal, not evidence of bias.
Frequently asked questions
Are these numbers truly random?
They are pseudo-random — generated by a fast algorithm from a changing seed. For everyday use they behave like truly random numbers, but they are not suitable for cryptographic keys or regulated lotteries.
Can the same number appear twice?
Yes. Each draw is independent, so duplicates are not only possible but expected — about a 9.65% chance of a repeat when drawing 5 integers from 1 to 100, and roughly 85% with 20 draws.
What is the range of values I can generate?
Anywhere from −1,000,000 to +1,000,000, with up to 3 decimal places.
Why do the numbers change every time I edit an input?
The tool recalculates instantly on any change, drawing a fresh sample. That behavior doubles as a re-roll button — change any value and change it back for a new draw.
What average should I expect from the default range?
The midpoint of 1 to 100 is 50.5, so the average of your draws will usually hover near 50.5, with individual values spread evenly across the whole range.
Are the draws independent of each other?
Yes. Each value is drawn separately from the same uniform distribution, so one result never influences the next — which is exactly why repeats happen.
Is this generator fair for a raffle?
For a casual raffle among numbered entries, yes: each integer in the range has the same chance. For regulated or legally binding draws, use a certified cryptographically secure generator instead.
How do I simulate a dice roll?
Set the range to 1 through 6, decimal places to 0, and how many numbers to however many dice you want to roll — the tool then acts as a fair d6 for each value.
How spread out are the draws?
For a uniform range of width 99 (like 1 to 100), the standard deviation of a single draw is about 99 ÷ √12 ≈ 28.6, so most values fall within roughly 29 points of the midpoint 50.5.
Why does my sample look clustered?
With only 5 draws, clustering in one region of the range is entirely normal — the same reasoning that makes an all-distinct sample likely also permits lopsided ones. Draw 10–20 values if you want a sample that looks more balanced.
Method and sources
- Uniform random sampling via the browser Math.random() API.