How the wheel picks a winner

The animation is decoration. The decision is cryptographic, on your device, before the wheel starts turning.

The algorithm in plain language

When you press Spin, the tool looks at the active entries and their weights. It asks the browser for uniformly chosen integers via crypto.getRandomValues, a cryptographic generator available in modern browsers.

Those integers pick one index: for equal weights, an integer from 0 to n−1; for unequal weights, an integer from 0 to (total weight)−1 that is then mapped onto the slices. Rejection sampling discards values that would bias the modulo.

Only then does the animation start. It rotates through extra full turns and eases toward a point inside the winning slice. Changing the duration slider does not change the index.

Try a live test

This test runs entirely in your browser. Nothing is sent to a server.

What this does not yet prove

A local test shows that this browser, on this device, is producing a plausible distribution. It does not yet publish a commit–reveal receipt that a distant sceptic can recompute. That proof page is planned. Until then, a recorded session plus the open description above is the practical transparency kit.

This page is maintained by Johny Virk.

Last updated 10 November 2026 (Asia/Karachi, UTC+5).

Frequently Asked Questions

Do you use Math.random?

No. Winner selection uses crypto.getRandomValues only.

What is rejection sampling?

If you take a 32-bit random integer and just use modulo n, some residues appear slightly more often when n does not divide 2^32. Rejection sampling draws again whenever the integer falls in the incomplete tail, which removes that bias.

Does a slower or faster spin change the winner?

No. The winner index is chosen first. Duration only changes how long the easing animation runs.

Why does the pointer never stop on a line?

After the index is chosen, a second random value picks a landing point between 10% and 90% of the way across that slice.

Will a chi-square test always pass?

Mostly, at p > 0.01, but about one in a hundred fair tests will fail a 1% significance threshold by chance. Run it again if a single run looks odd.