What it does
Spin the wheel turns your list into a wheel and picks one entry at random. Type or paste your entries, one on each line, and select Spin the wheel. The wheel turns for a few seconds and slows to a stop under the pointer at the top, and the entry it stops on is the pick.
The page opens with six foods on the wheel and no pick yet. Change the list and the wheel is redrawn with your entries.
How to use it
- Type or paste your entries in the box, one on each line. You need at least 2.
- Select Spin the wheel, or press Ctrl+Enter (⌘+Enter on a Mac).
- Watch the wheel turn. The pick appears above the wheel when it stops. Press Esc, or tap the wheel, to see it sooner.
- Select Copy to put the pick on your clipboard.
- Select Spin the wheel again to pick again from the same list.
The list can hold up to 100 entries, and blank lines are ignored. The page remembers nothing you type: a reload brings the six sample foods back.
How it works
The pick is drawn from your browser’s cryptographic random number generator, the same source used for encryption keys. The generator reads the browser’s random bytes 4 at a time, as a 32-bit value from 0 to 4,294,967,295. A plain remainder (modulo) would favour some entries, because 4,294,967,296 doesn’t divide evenly by most list sizes. So the generator sets aside the few values at the very top that would cause that: for a list of six, the last 4 values. If one of those comes up it’s skipped and the next one is used. What’s left divides evenly, so every entry has exactly the same chance.
The draw happens first and the wheel is then turned to show it. A second random value decides where in the winning slice the pointer stops, between a fifth and four fifths of the way along, so it never rests on the line between two slices. The wheel makes at least five full turns before it stops.
How it’s calculated
The chance of an entry is the number of lines that carry its name, divided by the number of entries. With Ana, Ben, Ana and Cho on four lines, Ana has 2 chances in 4, which is 50%, and Ben and Cho have 1 in 4 each, 25%. The six sample foods have 1 in 6 each, about 16.7%, and a list of 100 gives each line 1 in 100, 1%.
These shares are exact, not averages over many spins. The draw is a whole number from 0 to one less than the number of entries, and the entry at that place in the list is the pick. Every place has the same chance, because the generator sets aside the few raw values that would favour the first places (see How it works). The length of a name, its place on the wheel and the spins before play no part.
Worked examples
Four entries, one repeated
Type Ana, Ben, Ana and Cho on four lines in the Entries box. The wheel has four slices, and Ana has two of them. If the first value drawn is 2, the pick is Ana, from the third slice. If the second value is 300, the pointer stops at 0.2 + 300 ÷ 1,000 = 0.5, halfway along that slice.
The values 0, 1, 2 and 3 pick Ana, Ben, Ana and Cho in turn, so two of the four values give Ana.
The six sample foods
The page opens with Pizza, Tacos, Sushi, Curry, Burgers and Salad. A first value of 0 picks Pizza and a first value of 5 picks Salad. A value of 4,294,967,292 or more is set aside, as the last 4 values are for a list of six: if the first value is 4,294,967,292 and the next is 1, the pick is Tacos.
What the odds count
Feeding the draw every value from 0 to one less than the number of entries gives each place once. Over Ana, Ben, Ana and Cho that is Ana 2 times, Ben once and Cho once. Over the six foods it is 1 time each, and a name of one letter and a name of forty letters are each picked once in a list of two.
Common mistakes
- Typing a name twice by accident. Each line is its own slice, so Ana on two of four lines has 2 chances in 4, not 1 in 4. Read down the list for repeats before you select Spin the wheel.
- Waiting for an entry that is due. A spin starts from nothing: Ana’s chance is 2 in 4 on every spin, even after Cho has come up three times running. The same values always give the same pick, whatever was spun before.
- Separating names with commas on one line. Only a line break ends an entry, so Ana, Ben on one line is a single entry named Ana, Ben. Put each name on its own line.
Wheel entries and repeats
Entries are read line by line. A line break ends an entry, spaces at the start and end of a line are trimmed, and blank lines are dropped, so extra blank lines never add a slice. After trimming, Ana and Ana with a space after it are the same name, while Ana and ana are two different names.
A repeat is also a way to weight a pick on purpose. Three lines of Pizza among six give Pizza 3 chances in 6, 50%. The wheel has one slice for every line, repeats included.
Good to know
- Every entry is equally likely, however many slices share a name and however long the names are.
- A spin doesn’t depend on the last one. An entry that came up a moment ago is as likely as any other next time.
- The wheel’s slices are all the same size, whatever the length of the names.
- Pressing Esc, or tapping the wheel, doesn’t change the pick. It only skips the wait.
- The pick is always written out in full above the wheel, so you never have to read it off the wheel.
Privacy
The list is read and the pick is drawn in your browser, on your device. Nothing is sent to a server, and neither your list nor the pick is stored. Nothing you type is kept, not even in this browser’s storage.