Random Picker

Everyday & learning

Pick, shuffle, group, roll — unbiased, and it says how.

Result
—
Press draw to start.
What to do

How to use

What it's for

Draw raffle winners fairly, shuffle a list, split people into groups, pick a random number or roll dice — with every name exactly as likely as every other.

Before you start

Have the list of names or items, one per line — copied from a sign-up sheet or a chat works. For a number, know the lowest and highest allowed.

  1. Choose what to do

    Under What to do, pick Pick some, Shuffle, Split into groups, A number or Roll dice. Tapping one draws straight away with whatever is already in the boxes.

  2. Put in your list

    Replace the sample names in One per line with yours, one name on each line. Two people with the same name both stay in the draw, and a note points the repeat out.

  3. Set the numbers

    Fill in the boxes that appear: How many to pick, How many groups, Lowest and Highest for a number, or How many dice and Sides per die. Tick Allow the same one twice only if one name may win more than once — for a raffle, leave it off.

  4. Press Draw again

    Press Draw again to draw. Unlike most tools on this site, the result does not change as you type: a draw happens only when you press the button, so press it after every change.

Reading the result

  • Result: what was drawn — the names picked, the shuffled list, the number or the dice.
  • The draw: the same draw as a numbered list, in the order it came out. For numbers and dice, Total adds them up.
  • Groups: when splitting, how many groups there are, then each group's members. When the list does not divide evenly, the groups differ by one person at most.

If it goes wrong

  • The result did not change after you edited the list: nothing is drawn until you press Draw again. Press it once you have finished editing.
  • An error says you asked for more than there are to choose from: ask for fewer, add names or widen the range, or tick Allow the same one twice.
  • The same name came up twice: Allow the same one twice is ticked, or the name is in the list twice. Untick it, or delete the extra line.

What this is

People draw raffle winners with these, so this is held to the password generator’s standard rather than a toy’s.

Two things are wrong in almost every picker on the web, and both are invisible unless you count.

First, Math.random. It is not cryptographic — its internal state can be recovered from a short run of outputs, after which every past and future value is known.

Second, modulo bias. byte % 6 looks fair and is not: 256 does not divide by 6, so four of the six faces come up about 2% more often. Here a draw landing in the incomplete last block is discarded and redrawn — a few bytes of cost, and every outcome exactly as likely as every other.

And sort(() => Math.random() - 0.5) is not a shuffle. The result depends on the browser’s sort algorithm and some orders come up far more often than others. This uses Fisher-Yates.

Questions

Is this actually random?

It draws from crypto.getRandomValues, the browser's cryptographic random source — the same one the password generator on this site uses. Math.random is deliberately not used anywhere here: it is a non-cryptographic generator whose internal state can be recovered from a short run of outputs, after which every past and future value is known. For a raffle that matters.

What is modulo bias, and why should I care?

It is the bug in almost every picker on the web, and it is invisible unless you count. Taking a random byte and doing "byte % 6" looks fair but is not: 256 does not divide by 6, so four of the six faces come up about 2% more often than the other two. The fix is to discard any draw that falls in the incomplete last block and try again, which costs a few bytes and makes every outcome exactly equally likely. That is what this does.

Why is sorting by a random comparator not a shuffle?

Because a comparator that answers inconsistently breaks the contract every sort algorithm relies on. The result depends on which algorithm your browser uses and how the list was ordered to begin with, and some arrangements come up several times more often than others. The one-liner is famous and wrong. This uses Fisher-Yates, which visits each position once and is provably uniform.

Two people on my list have the same name. What happens?

Both stay in the draw, and the page tells you there is a duplicate. Two people really can be called Maria, and quietly collapsing them into one would halve her chance of winning. It is the sort of thing that only comes to light after the prize has been handed over, so it is said up front instead — you can delete one yourself if it was a typo.

How does it split a list into groups?

It shuffles the whole list, then deals it out one at a time across the groups, like cards. That matters when the numbers do not divide: dealing keeps every group within one member of every other, whereas slicing the shuffled list into blocks dumps the entire remainder on the last group.

Can I get the same result twice to prove a draw?

No, and that is deliberate. A reproducible draw needs a seed, and a seed that anyone can set is a draw that anyone can steer — which is exactly what you do not want for a raffle. If you need to evidence a result, record it as it happens: screenshot the list and the outcome together, or draw in front of the people involved.

The maths

Why byte % 6 is not fair
Byte values0–255
256 ÷ 642 remainder 4
Faces 1–443 ways each
Faces 5–642 ways each
Fix: discard ≥ 25242 ways each
About 1.6% of draws are discarded. A cheap price for an outcome that favours nobody.

Keep going

Important

Runs entirely in your browser; nothing is transmitted. Draws come from crypto.getRandomValues with rejection sampling — never Math.random, and never a random sort comparator. Duplicates in your list are reported, not removed. Nothing you type here is sent to our servers — the calculation runs entirely in your browser.