Random Line Picker – Draw a Fair Winner From Any List
Every giveaway, standup rota and team split eventually comes down to the same request: here is a list, choose one at random, and let nobody argue with the result. A random line picker answers it directly. Paste a block of text with one candidate per line — entrants, employee names, question numbers, log rows, dinner ideas — and one or more lines come back drawn uniformly at random. Nothing is uploaded; the list, the draw and the result stay in your browser, which matters when the lines are email addresses or unreleased data.
Why the source of randomness matters
The usual one-liner for picking an index is Math.floor(Math.random() * n), and it has two problems. The first is that Math.random is a fast statistical generator, not a cryptographic one — perfectly fine for a dinner suggestion, unsuitable for a prize draw people care about. The second is subtler: reducing a 32-bit random word with % n introduces modulo bias. Unless n divides 232 exactly, the first few indices are reachable from one more word than the rest and are drawn very slightly more often. This tool takes its randomness from crypto.getRandomValues, drawn through a rejection-sampling step that discards the ragged tail above floor(2^32 / n) * n so no index is favoured, and it never reduces a random word modulo the list length anywhere in the pipeline.
With replacement or without
These are two different experiments and picking the wrong one is the most common mistake in list draws. Without replacement, a line that has been drawn leaves the hat, so three picks produce three distinct names — the correct behaviour for a raffle with a first, second and third prize. The tool implements it with a partial Fisher–Yates shuffle, which touches only the positions it needs and so stays fast on a list of a hundred thousand entries. With replacement, every draw is independent and the same line may come up repeatedly, which is what models dice rolls, random prompt selection, or bootstrap resampling; a frequency table accompanies the result so repeats are easy to read.
Seeds make a random draw auditable
Randomness and accountability sound opposed, but a seeded drawdelivers both. Pin any whole number as the seed and the same list always produces the same winners, so a giveaway can be announced in advance, run in public, and re-checked afterwards by anyone who has the entry list. Leave the seed unpinned and a fresh one is drawn from the browser's cryptographic source and reported back to you, so even a spur-of-the-moment draw can be reproduced later. The downloadable draw record bundles the seed, the pool size, the method and a fingerprint of the entry list so an observer can confirm the list was not edited after the winner was known.
Weighted picking, shuffling and random groups
Not every draw is uniform. Turn on weighted mode and add a number to each line after a delimiter — Gold Prize,1 against Consolation,89— and each line's chance becomes its weight divided by the total weight, resolved with a cumulative-sum binary search. Shuffle mode returns the whole list in a uniformly random order for a playlist, a question bank or a running order. Group mode shuffles and then deals round-robin into K teams, which keeps sizes balanced: eleven names across three groups become 4, 4 and 3 rather than 5, 5 and 1.
Reading the odds
The statistics panel reports the same probability in every form people actually reason with — the fraction 1/12, the decimal 0.0833, the percentage 8.333% and the plain odds 1 in 12 — alongside the raw line count, the number of blanks skipped, duplicates collapsed and entries excluded. It also shows the chance any given line appears at least once across the whole draw, which is k/n without replacement and 1 − ((n−1)/n)^k with it. Winners carry their original line number so a name can always be traced back to the row it came from.