How PickerSpin Draws a Random Result

PickerSpin draws every result with crypto.getRandomValues(), the cryptographically secure random number generator built into the browser, and this page lets you test it yourself: run up to 100,000 simulated spins and check the chi-squared goodness-of-fit result.

Every spin uses your browser's cryptographic random number generator, not a predictable shuffle. You don't have to take that on trust — run up to 100,000 simulated spins on this page and check the distribution yourself.

What this test does and does not show

A chi-squared test on a long run of simulated spins checks one thing: that the generator's output is spread evenly across the options, with no slice quietly favoured. That is worth knowing, and it is what the button below measures.

It is not a receipt for any individual draw. It cannot show that a particular giveaway included every eligible entrant, that nobody edited the list between the entries closing and the spin, or that the result you saw is the one the generator produced. Those are questions about how a draw was run, not about the generator, and no distribution test can answer them. If a draw needs to be defensible to other people, record the entry list and the result at the time rather than relying on a fairness claim about the tool.

Why crypto.getRandomValues() instead of Math.random()

Math.random() is a seeded pseudo-random generator. The ECMAScript specification states that it must not be used for cryptographic purposes, because its sequence is reproducible to anyone who knows the seed. crypto.getRandomValues() is seeded from the operating system's entropy pool instead, so knowing every value it has already produced tells you nothing about the next one.

The winner is drawn before the wheel moves

PickerSpin picks the winning slice first and then animates the wheel to land on it. The animation is presentation, not selection, so there is no physics simulation that could drift toward a particular slice and no way for the visual result to disagree with the draw.

How the fairness test works

  1. Choose a number of options and a number of spins, up to 100,000.
  2. The test calls the same crypto.getRandomValues() the wheel uses and counts how often each option wins.
  3. It runs a chi-squared goodness-of-fit test against a uniform distribution and compares the result with the critical value at p=0.05.
  4. A pass means the variation you see is within the range genuine randomness produces. Perfectly equal counts would actually be a warning sign.

References

How PickerSpin Draws a Random Result — questions

Is PickerSpin truly random?

Yes. PickerSpin uses the Web Crypto API (crypto.getRandomValues), a cryptographically secure random number generator built into every modern browser. It is the same class of generator used for TLS keys and banking encryption.

How is crypto.getRandomValues different from Math.random?

Math.random() is a pseudo-random generator: it is seeded, its output is reproducible if you know the seed, and the JavaScript specification explicitly states it must not be used where cryptographic security is required. crypto.getRandomValues() draws from the operating system's entropy pool, so its output is unpredictable even to someone who has seen every previous value.

Can anyone predict the next spin?

No. A cryptographically secure generator is designed so that knowing all previous outputs gives no useful information about the next one. Each spin is statistically independent of every spin before it.

Why does my test show slight variations from the expected value?

That variation is what real randomness looks like. Perfectly equal counts would actually be evidence of a rigged generator. The chi-squared test on this page tells you whether the variation you see is within the range genuine randomness produces.

What is the chi-squared test?

The chi-squared goodness-of-fit test is a standard statistical method for measuring whether observed counts differ meaningfully from the counts you would expect under a fair distribution. If the chi-squared value is below the critical threshold at p=0.05, the results are statistically consistent with fair randomness.

How can I verify PickerSpin is fair myself?

Run the simulator on this page with any number of options and up to 100,000 spins. It calls the same crypto.getRandomValues() the wheel uses, counts how often each option wins, and reports the chi-squared result — so you are testing the actual mechanism, not a claim about it.