Command Palette

Search for a command to run...

List Randomizer: Shuffle a List or Pick Random Winners Fairly

List Randomizer: Shuffle a List or Pick Random Winners Fairly

T
Toolz Team
|Aug 23, 2026|16 min read

Part of the Generators collection

We ran a small giveaway for the Toolz launch, and I did the draw the lazy way: I pasted the entrant list into a spreadsheet, added a column of =RAND(), and sorted by it. It worked, but a friend who does statistics for a living looked over my shoulder and said, "you know that is not actually uniform, right?" He was correct, and the rabbit hole I fell into that evening is a big part of why Toolz now has a proper list randomizer that does the shuffle the right way. This guide is what I learned, written for anyone who needs to pull names out of a hat and wants the hat to be honest.

TL;DR: A list randomizer either reorders a whole list at random (shuffle) or draws a random sample from it (pick). The good ones use the Fisher-Yates shuffle and a cryptographic random source so every ordering is equally likely. Use shuffle for turn order and seating, and pick for giveaways and samples. This tool runs client-side, draws without replacement by default so winners are unique, and refuses to draw more unique items than the list holds.

I build SaaS products on Laravel and React, so I care about two things here: getting the math right, and making the interface obvious enough that you never wonder whether the draw was fair. Both turn out to matter more than they sound.

What is a list randomizer?

A list randomizer takes a list of items, one per line, and rearranges or samples it at random. A fair shuffle is a solved problem with a wrong answer that looks right: sorting by a random key is biased, while the Fisher-Yates shuffle is not, and the browser supplies the unbiased bits through crypto.getRandomValues(). Paste in names, prizes, tasks, teams, or ideas, and it either hands the whole list back in a shuffled order or picks out the number of winners you asked for. It is the software version of drawing folded slips from a bowl, with the advantage that it removes the quiet bias humans introduce when they try to choose "randomly" by hand.

There are really only two operations, and knowing which one you want is the entire skill. Shuffle returns every item you gave it, just in a new random order, so nothing is added or lost. Pick returns a subset, drawing a set number of items out of the pool. A raffle is a pick. Deciding who presents first in a standup is a shuffle. Most people reach for the wrong one at least once, usually trying to "shuffle and take the top three" when Pick with a count of three does the same thing in one step.

How does a fair shuffle actually work?

Here is the part my statistician friend was getting at. The spreadsheet trick, assigning a random number to each row and sorting, feels random but is not uniform. Sorting algorithms make comparisons, and when two random keys happen to be close, tiny biases in how ties and comparisons resolve leak into the result. On small lists the skew is small, but it is real, and for anything where fairness is the point, "close enough" is not a great answer.

The correct method is the Fisher-Yates shuffle, sometimes called the Knuth shuffle after Donald Knuth popularised the in-place version. It was described by Ronald Fisher and Frank Yates in 1938 and given its modern computer form by Richard Durstenfeld in 1964. The idea is simple. Walk the list from the last item to the second. At each position, pick a random index from the start of the list up to and including the current position, then swap the two items. Because each swap draws from a shrinking, well-defined range, every one of the possible orderings comes out with exactly equal probability. It runs in linear time, touching each item once, and it needs no extra memory beyond the list itself.

The list randomizer uses this algorithm directly. When you pick without replacement, it is the same shuffle stopped early: shuffle the list, then take the first N items. That guarantees the winners are distinct and that every possible group of winners is equally likely.

Where does the randomness come from?

An algorithm is only as fair as the random numbers feeding it. If the source of randomness is predictable or biased, a perfect shuffle still produces a skewed result. This is where the browser earns its keep.

Modern browsers expose crypto.getRandomValues, part of the W3C Web Cryptography API, which fills an array with cryptographically strong random values drawn from the operating system entropy pool. That is a much stronger source than Math.random, which is a fast pseudo-random generator never intended for anything where predictability matters. The randomizer prefers crypto.getRandomValues and only falls back to Math.random when the crypto source is genuinely unavailable, which on a current browser is almost never.

There is one more subtlety I had to get right. To turn a random 32-bit number into an unbiased index from 0 to N minus 1, you cannot just take the remainder after dividing by N, because unless N divides evenly into the range, the low indices come up slightly more often. The fix is rejection sampling: compute the largest multiple of N that fits in the range, and if a draw lands above that cutoff, throw it away and draw again. It costs a negligible number of extra draws and removes the bias entirely. The tool does this on every index it picks, which is the kind of detail nobody notices until it is missing.

How do I use the randomizer?

The interface has one button and a couple of choices. Here is how I run it.

Paste your list into the input box, one item per line. If you copied a comma-separated cell out of a spreadsheet, switch the input separator to comma and it will split on commas instead. Trim and drop-blank behaviour is on by default, so stray empty lines and accidental leading spaces do not become phantom entries.

Choose your mode. Shuffle reorders everything. Pick draws winners. If you choose Pick, a small panel appears where you set how many to draw and whether repeats are allowed. Leave repeats off for a giveaway so each winner is a different person. Turn repeats on only when you actually want sampling with replacement, for example when you are simulating dice-like draws and the same value can legitimately recur.

Click Randomize. You get a fresh, independent result every time, so if you want to redraw you just click again. Copy the output with one click to paste it into your announcement, your ticket, or wherever the result needs to live. If you ask for more unique winners than the list can supply, the tool tells you instead of quietly returning a short or repeated list, which is a mistake I have seen other tools make.

In practice, the lists I paste in are all over the map. Some days it is a column of customer emails for a prize draw, other days it is the names on my team for who reviews the next pull request, and once it was every restaurant within walking distance because nobody could decide on lunch. The tool does not care what the items are, only that they are separated cleanly. That is why the input options are worth a second of attention: if your source is a spreadsheet cell, the comma separator saves you from hand-editing, and if it is a messy copy-paste with blank rows, the drop-blank default quietly cleans it up before the draw. A minute spent formatting the input is a minute you do not spend arguing about whether a stray empty line counted as an entry.

When should I shuffle, and when should I pick?

The two modes cover different jobs, and the table below is the cheat sheet I wish I had when I started.

You want to... Use Repeats Why
Decide speaking or turn order Shuffle n/a Everyone stays in, order is fair
Draw one giveaway winner Pick, count 1 Off Single unique result
Draw several prize winners Pick, count N Off Distinct winners, no double-dipping
Assign people to two teams Shuffle, then split n/a Split the shuffled list in half
Sample with replacement for a sim Pick, count N On Same item may recur by design
Randomise a playlist or reading list Shuffle n/a Reorder without dropping anything

The rule of thumb: if the count of items should stay the same, shuffle. If you want fewer items out than you put in, pick. Team assignment is the one people overthink. Shuffle the full list, then take the first half as team A and the rest as team B, and both teams are random and balanced in size.

Is it fair enough to run a public giveaway?

Yes, and the reason is worth stating plainly because "fair" is the entire value of the tool. The combination of a Fisher-Yates shuffle, a cryptographic random source, and rejection sampling means every entrant has an identical chance and every possible set of winners is equally likely. That is a stronger guarantee than a physical draw, where slip size, folding, and how well the bowl is mixed all introduce bias.

Because the draw runs entirely in your browser, you can do it live on screen during a stream or a meeting, which is the transparency people want from a public draw. Nothing is sent to a server, so there is no hidden step where the result could be tampered with between your click and the announcement. If you want an audit trail, screen-record the draw: the entrant list is visible, the click is visible, and the winners appear immediately.

Is my list private?

This matters more than it first appears, because the lists people randomise are often not public. Candidate shortlists, internal team names, customer entries, and email lists are all sensitive. The randomizer processes everything locally with plain JavaScript. Your list is never uploaded, logged, or stored, and you can confirm that in your browser network tab, where clicking Randomize fires no request at all. It also keeps working offline once the page has loaded.

That is a deliberate stance across Toolz, and I wrote about the reasoning in the note on data privacy in online tools. A randomizer is a good example of why it matters: the input is often a list of real people, and a list of real people is exactly the kind of thing you do not want sitting in a request log on some server you have never audited.

A few habits that make draws cleaner

Clean the list before you draw. Turn on remove duplicates if one person might appear twice, so a double entry does not secretly double their odds. Dropping blank lines is on by default, but it is worth a glance to make sure a trailing empty line has not been counted.

Match the count to the prizes. In Pick mode, set the count to the exact number of winners you need and leave repeats off. If you have three prizes, draw three at once rather than clicking a single draw three times, which avoids the awkward case of the same name coming up twice across separate clicks.

Redraw openly, not secretly. If a winner is ineligible, remove them and redraw in front of whoever is watching. The fairness comes from the process being visible, not from the result being final on the first click.

Keep it in the browser. As with every tool I ship, local processing is the default because it is faster and private. If you are assembling a personal kit of small utilities, the random number generator pairs naturally with the randomizer for numeric draws, and the wider developer productivity tools roundup explains why a browser-first toolbox is worth building.

If random selection is a recurring need, a few neighbours sit close by. The random number generator draws numbers in a range with the same crypto-grade randomness, which is what you want when the thing you are choosing is a value rather than an item from a list. The UUID generator produces unique identifiers for records and test data. The password generator applies the same strong random source to producing secure passwords. All three run in the browser with no signup, exactly like the randomizer, and I cover the identifier side of that family in the password generator guide.

Frequently asked questions

How does the list randomizer work?

The tool reads your list one item per line, then either reorders every item or draws the winners you requested. Shuffling uses the Fisher-Yates algorithm, which walks the list once and swaps each item with a randomly chosen earlier position, producing a uniformly random order. The random positions come from the browser cryptographic generator so the result is genuinely unbiased.

Is the randomization actually fair?

Yes. It draws from crypto.getRandomValues, the cryptographic random source built into modern browsers, and uses rejection sampling so no index is even slightly more likely than another. Combined with the Fisher-Yates shuffle, every possible ordering of your list has an equal chance, which is fairer than manual shuffling or a spreadsheet sort with a random key.

How do I pick a random winner from a list of names?

Paste your names one per line, switch to Pick mode, set the count to 1, and click Randomize. The tool returns a single random name. To draw several winners at once, set the count higher and leave repeats disabled so each winner is unique.

What is the difference between shuffle and pick?

Shuffle returns your whole list in a new random order, so nothing is added or removed, only rearranged. Pick returns a subset, drawing the number of winners you specify from the list. Use shuffle for turn order or seating, and pick for giveaways, samples, or choosing a few people from a larger group.

Can the same item be picked more than once?

Only if you enable repeats. By default, Pick mode draws without replacement, so every winner is a different item, which is what a raffle or giveaway needs. Turning on repeats allows sampling with replacement, where the same item can come up again, which is useful for simulations.

Why can it not pick more unique items than my list has?

Without repeats, each winner must be a distinct item, so you cannot draw ten unique winners from a list of eight. When that happens the tool tells you instead of returning a wrong result. Either lower the count to match your list size or enable repeats so items can be reused.

Is my list uploaded to a server?

No. All parsing and randomization run locally in your browser with plain JavaScript, and nothing is transmitted, logged, or stored. You can confirm this in your browser network tab, where no request is made when you click Randomize. It also works offline once the page has loaded.

Can I use it for a raffle or giveaway?

Yes. Paste your entrants one per line, use Pick mode with repeats disabled, and set the count to the number of prizes. Each click draws a fresh, independent set of unique winners. Because the draw is unbiased and happens client-side, you can run it live on screen for transparency.

Comments

0 comments

0/2000 characters

No comments yet. Be the first to share your thoughts!