Selection comes first

The application draws an entry index using the browser’s crypto.getRandomValues API. Rejection sampling avoids modulo bias. With six equal entries, each entry has a one-in-six chance on every spin.

The wheel follows the result

After selection, the application calculates the angle that places the selected segment under the pointer. The spinning animation is a visual presentation of the result; its duration does not affect the selection.

Duplicates change label-level chances

If Pizza appears twice in a six-entry list, two segments represent Pizza. Each segment is equally likely, so Pizza has two chances out of six.

Repeats are normal

With entries retained, each draw starts with the same list. A name can repeat. To select without replacement, remove the winner manually or enable automatic removal.

Worked example: entries and labels are different

Suppose a wheel contains Pizza, Pizza, Pasta, and Salad. There are four selectable entries, each with a 1-in-4 chance. Pizza appears in two entries, so its label has a 2-in-4 chance; Pasta and Salad each have 1-in-4. Removing one selected Pizza entry leaves Pizza, Pasta, and Salad, with three equal chances. Removing every occurrence of Pizza would produce a different next draw. This application removes the selected entry, not every entry with the same label.

Why a repeated winner does not prove a problem

When the list is unchanged, previous results do not affect the next draw. With six entries, two consecutive draws both selecting one particular entry have a 1-in-36 chance. Two draws matching each other in any of the six possible entries have a 1-in-6 chance. These are different questions. A small result history can look uneven even when the selection method gives every entry an equal chance; it is not a guarantee that all names will appear within six spins.

What the implementation does—and does not guarantee

SpinWheelTool requests random unsigned 32-bit values through the browser's crypto.getRandomValues API. It rejects the small remainder that cannot be divided evenly into the entry count, then converts an accepted value to an index. The animation rotates to that index. Tests check the rejection boundary, entry mapping, and pointer alignment for lists of up to 500 entries. These checks establish intended software behavior, not independent certification, protection against a modified browser, or proof that an organizer entered an eligible list.

A quick test you can perform

Start with three different labels and spin several times. Check that the label in the result dialog matches the segment at the pointer. Change the spin duration and repeat; duration changes presentation, not the selection rule. Then enable Remove winner and draw three times: the list should decrease from three to two to one. Save the original list before the test if you want to restore it. Use result history to review your session, and inspect entries whenever the observed odds seem surprising.

Browser API reference

For the browser API's behavior and constraints, see MDN's crypto.getRandomValues documentation. SpinWheelTool's selection and animation behavior described above comes from its implementation and tests.