🎲 Random Name Picker
A random name picker that draws one or several winners with no repeats, using the same cryptographically secure randomness as a password generator.
What Random Name Picker Does
A random name picker is a one-line algorithm wearing a UI: choose an index uniformly between 0 and the list length, and return the name at that index. The interesting engineering is not in the pick, it is in making "uniformly" actually true and in what happens when you need several distinct winners rather than one.
Two design choices decide whether a name picker is trustworthy. The first is the source of randomness: `Math.random()` is deterministic from an internal seed state and is not the honest default for anything people call "fair" or "random winner" — this tool uses `crypto.getRandomValues()`, the same cryptographically secure source this site's password generator uses, with rejection sampling so a name at index 3 of 7 has exactly the same chance as a name at index 0, not a chance biased by how 2³² divides by 7.
The second is duplicates. Rather than inventing a separate "weight" field, this tool lets a name's odds scale naturally with how many times it appears in the list — list someone twice and they are twice as likely to be drawn, which is both simpler to explain and easier to verify by eye than a percentage slider.
The third is what "several winners" means. Removing each winner from the pool before the next draw (sampling without replacement) guarantees distinct winners, the standard behavior for a raffle. Leaving winners in the pool (sampling with replacement) makes each draw independent, which is what you want for something like "pick this week's presenter" where a repeat is not a bug.
How to Use Random Name Picker
- Paste or type one name per line into the list
- Set how many winners to draw, and whether winners are removed from the pool
- Click Pick — the tool draws using cryptographically secure randomness and shows the result
Formula Used by Random Name Picker
Probability of a single name being drawn
P(name) = (occurrences of that name) ÷ (total entries)
- occurrences
- How many lines in the list are that exact name — this is how duplicates act as weight
Worked example
A list of 10 lines: "Alex" appears twice, and 8 other names appear once each (2 + 8 = 10 lines, 9 unique people).
- Alex: 2 ÷ 10 = 20%
- Each of the other 8 names: 1 ÷ 10 = 10%
- Check: 20% + (8 × 10%) = 100%
Result: Alex has double the chance of any other single name, and every probability on the list still sums to exactly 100% — a quick way to catch a miscounted entry.
A specific person's chance of being one of several distinct winners
P(specific person wins) = winners drawn ÷ total entries (sampling without replacement)
- winners drawn
- How many distinct winners this draw picks
Worked example
Drawing 3 distinct winners from 10 names, no repeats.
- This follows from combinatorics: C(9,2) ÷ C(10,3) = 36 ÷ 120
- = 0.30
Result: 30% — the same as 3 ÷ 10. Every one of the 10 people has exactly this chance, which is what makes removal-based drawing fair for a raffle with multiple prizes.
With replacement vs. without replacement, drawing 3 winners from 10 names
Without replacement (removing each winner) always returns 3 distinct people. With replacement, the same name can be drawn more than once — computed as 1 minus the chance of three distinct draws in a row: 1 − (10/10 × 9/10 × 8/10).
| Mode | Distinct winners guaranteed? | Chance of at least one repeat among 3 draws |
|---|---|---|
| Remove winners from pool (without replacement) | Yes, always | 0% — impossible by construction |
| Leave winners in pool (with replacement) | No | 28.0% |
Chance of at least one repeat, with replacement, by list size and draw count
Every figure is 1 − the product of (n−i)/n for i from 0 to draws−1 — the same style of calculation behind the "birthday paradox".
| List size | 2 draws | 3 draws | 5 draws |
|---|---|---|---|
| 5 names | 20.0% | 52.0% | 100% |
| 10 names | 10.0% | 28.0% | 69.8% |
| 20 names | 5.0% | 14.5% | 39.1% |
How to Read Your Result
Duplicates are the weighting system, not a bug
If a name should have better odds — a second entry for someone who bought two raffle tickets, say — list it twice. The math above shows this is exactly equivalent to a percentage weight, and it is checkable by counting lines rather than trusting a slider.
Choose replacement mode by what a repeat would mean
A raffle with distinct prizes needs winners removed from the pool — nobody should win the same prize category twice in one draw. A recurring pick like "who presents this week" is usually better left with replacement on, since forcing everyone through once before any repeat is a different feature (a rotation), not a random pick.
Small lists repeat far more than intuition suggests
With 5 names and 3 draws with replacement, the table above shows the chance of at least one repeat is already 52% — better than even odds. This is the same effect behind the classic birthday paradox, and it is why "with replacement" mode is a poor choice for small groups unless repeats are genuinely fine.
Limitations & Accuracy Notes
- Randomness comes from the browser's CSPRNG (crypto.getRandomValues()), which in turn depends on the operating system's entropy source. This tool cannot verify that source; it can only avoid adding bias on top of it, which rejection sampling does.
- Duplicate names are indistinguishable once drawn — if two different people are both named "Alex", the tool cannot tell them apart, and the winner display will just say "Alex" for whichever entry was drawn.
- The list and draw history live only in the browser tab's memory; refreshing the page clears both. There is no save, export or shareable-link feature.
- This does not simulate a physical process like a lottery ball machine or a spinning wheel — it computes an index. The visual "shuffle" before landing on a result is a UI effect, not part of the randomness itself.
- Very long lists (many thousands of lines) are limited by browser memory and rendering, not by the algorithm, which is O(1) per draw regardless of list size.
Frequently Asked Questions
Is this actually random, or could the same person keep winning?
How do I give one name better odds than the others?
What does "remove winners from the pool" actually change?
Can I pick more than one winner at once?
Is my list of names uploaded anywhere?
Why not just use Math.random() to pick a name?
References & Further Reading
- MDN — Crypto.getRandomValues() — The cryptographically secure random source this tool draws from, the same one used by this site's password generator
- NIST SP 800-90A Rev. 1 — Recommendation for Random Number Generation Using Deterministic Random Bit Generators — The federal standard underlying CSPRNG design, including why rejection sampling is needed to keep a bounded random integer unbiased