How Random Number Generation Works
A random number generator picks values from a range you choose, with no pattern and no favourites: set a minimum, a maximum, and how many numbers you want, and the tool returns that many integers drawn blind from the range. Use it to pick a raffle winner from ticket numbers 1 to 500, roll two dice, or choose which five students present first. Because the choice is mechanical rather than human, nobody can argue the result was rigged — every value in the range had exactly the same chance of appearing as any other.
What “Random” Means Here: A Uniform Range
Formally, the tool draws from a discrete uniform distribution over the integers from min to max, inclusive. Min is the smallest value that can appear and max the largest — both endpoints count, so a range of 1 to 6 really can produce a 1 and a 6. Count is how many values one click produces, from 1 to 100. The range size is max − min + 1, and each value’s probability is 1 divided by that size: a fair die gives every face probability 1/6 ≈ 16.7%. “Random” here means pseudorandom — your browser’s built-in generator starts from a seed and applies a deterministic algorithm whose output is statistically uniform. That is entirely suitable for games, draws, and sampling, but it is not cryptographic security.
How to Use the Generator
- Type the smallest allowed value in the Min box and the largest in the Max box — for a standard die, 1 and 6.
- Set Count to how many numbers you need in a single draw, anywhere from 1 to 100.
- Tick the no-duplicates checkbox if every result in this draw must be different, then press Generate.
- Read your numbers in the dark result panel. Earlier draws stay listed in the History panel below, so a raffle audience can follow the sequence of picks.
With and Without Duplicates
- Allow duplicates: every draw is independent — like rolling a die repeatedly.
- No duplicates: each number can appear only once — like drawing names from a hat. The count cannot exceed the size of the range.
Worked Example 1: Picking a Raffle Winner from 200 Tickets
Suppose 200 raffle tickets were sold, numbered 1 to 200, and one winner must be drawn publicly. Set Min = 1 and Max = 200, so the range size is 200 − 1 + 1 = 200 values. Set Count = 1, because only one winning ticket is needed; the duplicates setting is irrelevant for a single number, so leave it unticked. Before you press Generate, every ticket has probability 1/200 = 0.5% of winning — no ticket is favoured, including ticket 1 and ticket 200 themselves. Press Generate and announce the number shown; its holder wins. If you draw again for a second prize, that draw is independent: the first winning number is just as likely to appear again unless you tick no-duplicates and draw both prizes in one go.
Worked Example 2: Choosing 5 Presenters from a Class of 30
Number your 30 students 1 to 30 in register order, then set Min = 1, Max = 30, and Count = 5. This time tick no-duplicates: with duplicates allowed, the same student could legitimately appear twice in the five picks and you would face awkward redraws, whereas no-duplicates guarantees five different students, like drawing five names from a hat. The draw is valid because the count, 5, does not exceed the range size, 30. Each individual student’s chance of being chosen is 5/30 = 1/6 ≈ 16.7% — there are 5 winning slots spread evenly among 30 students. Press Generate, read the five numbers aloud, and the matching students present, with the History panel as your record that the selection was made once, fairly.
When to Use a Random Number Generator
Reach for this tool whenever a choice must be visibly fair. Event organisers draw giveaway winners and raffle prizes with it because the audience can watch the draw happen. Teachers cold-call students and form random groups without playing favourites — the no-duplicates mode guarantees nobody is picked twice in one round. Board-game players replace lost dice, statistics students pull random samples from a class list, and researchers assign volunteers to group A or group B. It also settles small everyday disputes: who goes first, which restaurant, which playlist.
Three Mistakes to Avoid
- Asking for more unique numbers than the range holds. Ten different numbers cannot come from 1 to 5 — only five distinct values exist. Widen the range or lower the count.
- Falling for the gambler’s fallacy. A number that has not appeared for ages is not “due”. Every draw is independent, so each value’s probability stays exactly 1 divided by the range size.
- Using draws as passwords or PINs. A pseudorandom generator is built for fairness, not secrecy. For anything security-related, use a password manager’s cryptographically secure generator instead.
Is It Truly Random?
For games, giveaways, and sampling — yes, effectively. For cryptography or security tokens, use a cryptographically secure generator instead; browser Math.random is not designed for secrets. Curious about the math of chance? Try our probability calculator.