Lelifi·tools

Random Number Generator

A random number from 1 to 100 gives each whole number a 1 percent chance. Draw 5 numbers from 1 to 100 and 9.7 percent of draws contain a duplicate. This page uses the browser's cryptographic source, shows the odds of every range, and can replay a draw from a seed you type in.

Pick numbers from a range or names from a list. The results tell you the range, the count and the source of the randomness.

Generate random numbers in any range or pick from a list of names, with the odds of every draw shown and an optional seed you can replay later.

By the Lelifi editors ·

Key takeaways

Why the odds shift on every draw in a raffle50 people, 3 prizes, no repeats1 / 50 = 0.02 for the first name1 / 49 = 0.0204 for the second1 / 48 = 0.0208 for the third50 x 49 x 48 = 117,600 ordered draws117,600 / 6 = 19,600 possible setsEach person still has a 3 in 50 chance of being one of the three winners.
Each prize changes the pool size, so the odds per name shift slightly as the draw goes on.
Chance of at least one repeated number when drawing from 10037.2%87.0%100.0%3 draws (3.0%)5 draws (9.7%)10 draws (37.2%)20 draws (87.0%)50 draws (100.0%)
The longer the list you draw from, the faster repeats show up, which is the birthday problem in numbers.
On this page
  1. What a random number generator returns
  2. How the numbers are produced, and why Math.random is not enough
  3. Working out the odds before you draw
  4. Worked example: a 50 person raffle with three prizes
  5. Picking from a list instead of a range
  6. When a seeded draw beats a one-off draw
  7. Where a random number is the wrong tool

What a random number generator returns

A random number generator takes a starting range and hands back a number from it, with every number in that range equally likely. Ask for a whole number between 1 and 100 and each of the 100 numbers has a 1 percent chance. Ask for a number between 1 and 6 and each face has a 1 in 6 chance, which is 16.7 percent. There is no memory in the tool, so a 7 that came up last time carries no weight into the next draw.

Three things make a draw meaningful, and this page handles all three:

None of that makes a draw fair on its own. Fairness comes from the range and the rules being fixed before the draw, not from the quality of the number machine. A page that rolls a better random number still cannot fix a raffle where the organizer picks the winner by hand.

How the numbers are produced, and why Math.random is not enough

Browsers offer two sources of randomness, and they are not interchangeable. The Math.random() function that most web code reaches for is fast, decent for games and animations, and not built for anything where a person might want to predict the next result. The Web Crypto API exposes crypto.getRandomValues(), which is designed to survive an attacker who knows every previous output.

The MDN reference for getRandomValues notes one practical limit: a single call fills at most 65,536 bytes, which is 16,384 four byte numbers, so a large batch takes more than one call. The NIST SP 800-90A publication sets out the design rules for the deterministic generators that sit underneath these sources, and the W3C Web Crypto specification defines how browsers expose them to pages.

SourcePredictable from past outputSpeedGood for
crypto.getRandomValuesNo, not in practiceFast enough for thousands of drawsRaffles, sampling, audit trails
Math.randomYes, the state can be recoveredFastestAnimations, game feel, jitter
Seeded generator on this pageYes, by designFastReplaying a draw for verification

Seeded mode is the opposite of a security feature. A typed seed fixes the sequence, so anyone with the same seed and range gets the same numbers. That is what you want when the claim is we ran this draw once and here is the proof, and what you do not want for a password.

One more detail worth knowing: a raw random byte has 256 possible values, and dividing that by 6 does not divide evenly. 4 x 43 + 2 x 42 = 256, so a naive method makes four outcomes slightly more likely than the other two. Good generators avoid this by rejecting values that fall in the leftover part of the range and drawing again, which is what this page does.

Working out the odds before you draw

Most surprises with random draws come from arithmetic nobody did. Drawing 5 numbers from 1 to 100 sounds like 5 separate chances, but the chances shrink as you go, and the chance of a repeat grows fast.

Numbers drawn from 100Chance of at least one repeatWhat it looks like in practice
33.0 percentRare enough that most people expect it never to happen
59.7 percentOne in ten draws, so expect it occasionally
1037.2 percentMore likely than not
2087.0 percentA repeat is the normal case
50Effectively certainA list with no repeats is the exception

The same idea drives the birthday problem. In a room of 23 people there is a 50.7 percent chance that two share a birthday, even with 365 days in the year, because 23 pairs is a lot of chances to land on the same date. The name comes from that surprise, not from a party. Drawing many numbers from a small range is the same calculation wearing different clothes.

For a raffle, the numbers that matter are per person rather than per draw. In a pool of 50 names, each person has a 1 / 50 = 0.02 chance of the first prize. After that name is removed the second prize has a 1 / 49 = 0.0204 chance and the third a 1 / 48 = 0.0208 chance, so each person ends up with a 3 in 50, or 6 percent, chance of taking one of the three prizes. A common mistake is to advertise the second prize as 1 in 50 too, which flatters the odds of the first winner and confuses the rest.

Worked example: a 50 person raffle with three prizes

Here is the whole calculation for a raffle with 50 entries and 3 prizes, drawn without replacement.

Every ordered sequence of three different names is equally likely, and there are 50 x 49 x 48 = 117,600 of them. Because the order of the three prizes does not matter for who wins what, the number of possible sets of three winners is 117,600 / 6 = 19,600, since each set can be ordered six ways. A single named person's chance of being in that set of 19,600 is 3 in 50, which is 6 percent, and their chance of being the first name is 2 percent.

Worked example two, a simpler one. Draw 5 numbers from 1 to 100 with no repeats allowed. The chance that all five are different is 100 x 99 x 98 x 97 x 96 / 100^5 = 0.9035, so 90.4 percent of draws come back with five distinct numbers and 9.7 percent contain a repeat. Each single number, 1 included, still has exactly a 1 percent chance of appearing somewhere in the list, the same as its chance on any one draw. That last fact is what makes the list fair even though the individual draws are not symmetric.

Now the case most raffles get wrong. If the raffle allows repeats, so the same person can win twice, then the first prize is still 1 / 50 = 0.02 per draw but a second prize can land on the same name, and the number of distinct winners drops below 3. The chance that all three prizes go to different people falls to 0.98 x 0.96 = 0.9408, so about 6 percent of draws produce fewer than 3 winners. Either rule is fair if it is published before the draw, and unfair only if the organizer switches to whichever rule gives a preferred result.

Picking from a list instead of a range

Sometimes the pool is already written down: names on a sign-up sheet, products in a warehouse, chores on a board. That case is a sample from a known set, and the odds work out the same way as the range case, with the set size replacing the upper bound.

Two choices matter, and both change the number you should quote:

SettingWhat it means5 picks from 50 entries
Repeats allowedEach pick is independent, so a name can come up twice18.6 percent chance of a duplicate
No repeatsA picked entry leaves the poolEvery pick is a different entry
Sorted outputOrdering after the draw, which changes no oddsSame set, easier to read back

Most raffles and most workload splits want no repeats, because a person who already won should leave the pool. The page reports which setting produced the result, so the rule is on the record.

When a draw has to be checked later, the audit trail matters more than the number. Write down four things: the range or the list, the count, whether repeats were allowed, and the seed if one was used. Those four lines are enough for someone else to rerun the same draw and get the same output, which is the point of a published seed. A screenshot of a result, on its own, proves nothing about how the result was produced.

For a bigger job, such as picking 30 of 900 names for a survey, the same generator handles it in one pass. Check that the list itself carries no order that matters: a sheet sorted by team or by signup time still gives every person an equal chance in a full shuffle, but drawing from the end of it does not.

When a seeded draw beats a one-off draw

Seeded mode answers a narrow question well: can you reproduce this result later? The seed is turned into a starting state for a small deterministic generator, and the sequence from that state is the same on every device and every visit. A demonstration of a shuffle, a reproducible example for a blog post, a test case that has to keep failing in the same way, or a draw that has to be replayed in front of an audience, all benefit.

Use a plain text seed such as a date, a ticket number, or a phrase. Keep it short enough to read aloud. The generator here mixes the characters of the seed before it starts, so a seed of 2026-10-23 does not behave like a nearby seed of 2026-10-24, which matters if seeds are being guessed at.

Two rules keep a seeded draw honest. Publish the seed before the draw, not after, or the seed is just a number that produces a result you liked. And keep seeds out of anything that has to stay secret: a seed that anyone can read is not a secret, and the password generator on this site is the right tool for secrets because it never stores or repeats a value you have seen.

Where a random number is the wrong tool

Some jobs need a random number and some need something else, and picking the wrong one causes real harm.

For everyday use, a random number is a good tool for breaking a tie, choosing between equally good options, sampling a few items from a long list, splitting chores, picking a restaurant, or generating test data. For a quick dice-style roll with face counts and modifiers, the dice roller on this site is built for that. For a lottery with published odds and prize tiers, the lottery odds calculator covers the numbers.

What this page will not do is make a decision for you. It gives you a number from a range you set, under rules you set, and shows the odds of that range so the number means something. Whether the range was fair is still your call, and it is the call that matters most.

Frequently asked questions

How do I generate a random number between 1 and 100?

Set the range to 1 and 100 and press the button. Each of the 100 numbers has a 1 percent chance, so a single draw tells you little on its own. Draw 10 and you have a 37 percent chance of seeing a repeat.

What is the probability of getting the same number twice?

From 100 numbers, 3 draws repeat 3.0 percent of the time, 5 draws repeat 9.7 percent, 10 draws repeat 37.2 percent and 20 draws repeat 87.0 percent. The chance rises because each draw leaves fewer unused numbers behind.

Is this generator truly random?

It uses the browser's crypto.getRandomValues when it is available, which is the source designed to be unpredictable even to someone who knows every earlier output. The results row says which source produced the draw, and Math.random is only used as a fallback.

What is a seed for and should I share mine?

A seed fixes the sequence so the draw can be replayed later on any device. Share it when you want to show your work, such as in a published raffle, and publish it before the draw. Never use a visible seed for a password, a code, or anything else that has to stay secret.

What are the odds in a raffle with 50 entries and 3 prizes?

The first name has a 1 in 50 chance, the second a 1 in 49 chance and the third a 1 in 48 chance, because winners leave the pool. Each person has a 3 in 50, or 6 percent, chance of winning something, and there are 19,600 possible sets of three winners.

Should draws allow the same entry to be picked twice?

It depends on the rules, and the rules need to be fixed before the draw. With repeats allowed, about 6 percent of three prize draws from 50 entries produce fewer than 3 different winners. With repeats blocked, every prize is a different person and the odds per person stay flat at 3 in 50.

How many numbers can I generate at once?

The page caps a single batch at 500 numbers so the browser stays responsive. The underlying source fills at most 65,536 bytes per call, which is 16,384 four byte values, so a very large batch is drawn in several calls behind the scenes.

Is a random number generator the right tool for a giveaway?

For a small informal draw, yes, as long as the range and rules are set before the draw and the seed is published. For a prize draw with real money, use a licensed operator with audited procedures. A page cannot provide the audit trail or the legal standing that money requires.

Why do the odds change on every draw in a raffle?

Because winners are removed from the pool. The first draw has 50 candidates, the second has 49 and the third has 48, so each chance rises slightly. That is also why a named person's overall chance stays at 3 in 50 across the whole draw.

Can I use this to pick lottery numbers?

You can generate any combination you like, and the odds of any combination are identical, which is the point of a fair lottery. For the published odds of Powerball and Mega Millions, and what those odds mean in practice, the lottery odds calculator on this site works through the numbers.

Does this page send my numbers anywhere?

No. The whole calculation happens in your browser, and nothing you type is uploaded, logged or stored. A seeded draw can be replayed by anyone who knows the seed, which is useful for verification and a good reason to keep seeds away from secrets.

What is the difference between this and a dice roller?

A dice roller understands dice notation such as 2d6+3, adds the faces together and works out the distribution of the total. This page draws numbers from any range you set, can keep them distinct, and can replay a result from a seed. Different tools for different jobs.

How do I pick winners from a list of names?

Paste the names into the list box, one per line, set how many you need, and turn off repeats. The page then samples from that list without replacement and reports the list size, the count drawn and whether repeats were allowed, which is the record you want to keep.

Spotted a wrong number or a broken result?

More Everyday tools

See all Everyday tools

Fee schedules, rates and rules change without notice. Always confirm important figures with the official source before you rely on them.