1. Build the active list
Before a spin, the tool identifies which entries are eligible. Blank labels, disabled entries, and zero-weight entries are removed from the effective selection range. This prevents a visual placeholder from becoming an unexpected result.
On an equal wheel, every remaining entry receives the same share. On a weighted wheel, each entry receives a share proportional to its weight.
2. Ask the browser for randomness
The browser supplies random bytes through the Web Crypto interface. Those bytes are converted into a value within the wheel’s probability range. Selection happens locally; the list does not need to be sent to a remote drawing service.
3. Map the value to an option
Imagine an equal wheel with four options. The range can be divided into four equal intervals. A value in the first interval selects option one, a value in the second selects option two, and so on.
For weights 5, 3, and 2, the cumulative intervals cover 50%, then 30%, then 20% of the range. The first interval containing the random value determines the result.
4. Calculate the landing angle
Each visible segment has a start angle and an end angle. Once the winner is known, the wheel chooses a landing position inside the winning segment and calculates the rotation needed to bring that position beneath the pointer. Extra full turns create the spinning motion without changing the result.
5. Display and record the result
When the animation finishes, the selected label is displayed. Depending on the tool and settings, the result may be added to local history or removed from the next draw. That later state change affects future spins, not the spin that just finished.
What can make a wheel unfair?
- Adding the same participant more than once when duplicates are not intended.
- Using weights without explaining them to the affected group.
- Changing the eligible list after publishing the rules.
- Repeatedly spinning until a preferred outcome appears.
- Using a simple browser tool where an independent or audited process is required.
A practical check before spinning
Read the active list aloud or display it, state whether winners remain eligible, explain any weights, and decide what happens if the selected person or option is unavailable. A transparent rule does more for perceived fairness than a dramatic animation.