List randomizer

Shuffle a list, or draw a few winners fairly from it.

Publish a seed to make the draw verifiable

8 entries

Shuffled order

  1. Margaret Hamilton
  2. Ada Lovelace
  3. Edsger Dijkstra
  4. Alan Turing
  5. Donald Knuth
  6. Katherine Johnson
  7. Barbara Liskov
  8. Grace Hopper

How it works

Shuffling uses the Fisher–Yates algorithm, which produces every possible ordering with equal probability in a single pass. Drawing winners shuffles and takes from the front, so each entry has exactly the same chance and nobody can win twice.

The naive shuffle is biased

Sorting a list with a random comparator — arr.sort(() => Math.random() - 0.5) — is the most common shuffle in the wild and it is wrong. Sort algorithms assume a consistent comparator; giving them a random one produces measurably uneven distributions, with the exact bias depending on the engine's sort implementation. Fisher–Yates is barely more code and is provably uniform.

Running a defensible giveaway

  1. Freeze the entry list and publish it, or publish a hash of it.
  2. Announce the seed source in advance — a specified future lottery draw, a block hash, a public random beacon.
  3. After that value exists, run the draw with it as the seed.
  4. Publish the seed and the list. Anyone can reproduce the result here.

That sequence removes the need for participants to trust you, which is the only property that actually matters in a public draw.