Fairness

How the Randomness Works

Every ChalkSpin spin is decided the moment you press Spin by your browser's cryptographic random number generator (crypto.getRandomValues). The wheel then animates to that result, every slice is drawn to its exact share of the odds, and there is no hidden setting that can rig the outcome.

Last reviewed 7-minute read

Generator
Web Crypto crypto.getRandomValues, in your browser
Method
Rejection sampling, so there's no modulo bias
Odds
Weight ÷ total weight, the same as the slice's share of the wheel
Result
Picked before the wheel moves; the wheel then lands on it
Hidden settings
None. Weights are drawn as wider slices
Your list
Stays in your browser unless you save or share it

What happens when you press Spin

Five steps, all inside your browser, in a few milliseconds:

  1. Read the wheelChalkSpin takes the entries and their weights exactly as they appear in your list.
  2. Draw a random numberYour browser's cryptographic generator produces a random whole number from 0 to one less than the total weight.
  3. Find the winnerThat number falls inside one entry's share. With weights 1, 2 and 1, the numbers 0, 1–2 and 3 belong to the three entries.
  4. Animate to itThe wheel turns five to seven times and comes to rest well inside the winner's slice, never on a line.
  5. Show and recordThe winner appears big, is read out to screen readers, and goes into the history with the time.

Where the randomness comes from

ChalkSpin uses crypto.getRandomValues, part of the Web Crypto standard that every modern browser supports. It's a cryptographically secure random number generator, seeded by your device's operating system from unpredictable physical events. Browsers use the same source to create security keys, so it's built to be impossible to guess.

Many simple spinners use Math.random() instead. That's fine for games, but it isn't designed to be unpredictable: its sequence can be worked out from a handful of earlier results. ChalkSpin never uses it to decide anything.

Strictly, both are "pseudo-random": computed rather than measured from nature. For a cryptographic generator the difference can't be detected, which is why banks and browsers trust it, and why it's more than fair enough for choosing who reads next.

No modulo bias: rejection sampling

The generator hands out random 32-bit numbers: one of 4,294,967,296 equally likely values. To turn that into a pick from 30 names, the obvious move is to take the remainder after dividing by 30. But 4,294,967,296 isn't a multiple of 30. It leaves 16 values over, so 16 of the names would get one extra chance in 4.3 billion. Tiny, but not equal.

ChalkSpin removes that bias completely with rejection sampling: if the number lands in the leftover range at the very top, it's thrown away and a new one is drawn. For 30 names that happens about once in 268 million draws, and every name ends up with exactly the same chance. This is the code every ChalkSpin tool uses:

randInt, from ChalkSpin's shared code
/** Fair integer in [0, n): rejection sampling, so there is no modulo bias. */
export function randInt(n) {
  const limit = Math.floor(4294967296 / n) * n;
  const u = new Uint32Array(1);
  do crypto.getRandomValues(u);
  while (u[0] >= limit);
  return u[0] % n;
}

Slices drawn to scale

On ChalkSpin the picture is the probability. Each slice's angle is its entry's weight divided by the total weight, times 360°, and the pick uses the same numbers. What the class sees on the board is exactly the chance each name has.

A wheel with four names. Jonah has weight 2, so his slice is twice as wide as each of the others.
Weights, slice sizes and chances for the four names
EntryWeightSliceChance
Maya×172°20%
Jonah×2144°40%
Ava×172°20%
Leo×172°20%
Slice angle = 360° × weight ÷ total weight. Jonah's ×2 gives him 144° of the wheel and a 2 in 5 chance; Maya, Ava and Leo get 72° and a 1 in 5 chance each.

Nothing hidden: why the wheel can't be rigged

  • The winner is chosen before the wheel moves. Spin length, the number of turns, the theme, sounds and confetti only change how the result looks.
  • There are no hidden weights. A weight shows as a wider slice and a ×2 badge in the list. There's no secret "next winner" or "always skip" setting anywhere in ChalkSpin.
  • The draw happens in your browser. No request goes to a server to pick a winner, so nobody, including us, can steer it from outside.
  • Everyone sees the same wheel. A share link carries the entries and their weights, so anyone who opens it sees the same odds you do.
  • Every pick is on the record. The spin history lists each winner with the time, and can be copied as proof for a giveaway.

The only ways to change the odds are ones the room can see: giving an entry a weight, adding the same name twice (ChalkSpin flags duplicates), or removing a name, for example a student who's absent today.

Try it: run a fairness test

Don't take our word for it. This spins a small wheel thousands of times right now, in your browser, with the same function the real wheel uses. Change a weight and watch that name's share follow its slice.

Spins
Fairness test results: wins and observed share for each entry compared with its expected share
EntryWeightShare chartWinsObservedExpected
Maya
×1
––20.0%
Jonah
×2
––40.0%
Ava
×1
––20.0%
Leo
×1
––20.0%

Press Run the test to spin this wheel thousands of times in your browser.

Why the same name can come up twice

Each spin is independent: the wheel doesn't remember who won last time, the same way a coin doesn't. So repeats are normal, and they happen more often than most people expect.

  • With 25 names, the next spin has a 1 in 25 (4%) chance of picking the name that just won.
  • Over 5 spins, there's about a 35% chance that some name comes up twice.
  • Over 10 spins, it's about 88%.

If you want everyone to have a turn before anyone goes again, switch on Remove winner: each winner leaves the wheel after their spin (and Undo brings them back). The random name picker is built around the same idea: no repeats until everyone has had a turn.

Instant result and reduced motion

Instant result skips the animation and shows the winner straight away. It uses exactly the same draw, so the odds don't change. If your device is set to reduce motion, ChalkSpin shows results instantly on its own and turns off the celebrations.

The other tools use the same fair draw

Every ChalkSpin tool builds on the same three functions: a fair whole number, a fair weighted pick, and a fair shuffle.

  • Random name picker: draws from the names still waiting, so nobody repeats until everyone has been picked.
  • Group generator: shuffles the class with a Fisher–Yates shuffle, where every possible order is equally likely, then deals people into groups.
  • Random number generator: every number in your range has the same chance; with no repeats, each number comes up once.
  • Yes or no wheel: two equal slices, a true 50/50 (or three equal ways with Maybe).
  • Bingo cards: each card's squares and the calling order are shuffled the same fair way.

Frequently asked questions

Is the spinner wheel truly random?

Yes, in every way that matters for a classroom. Each spin uses crypto.getRandomValues, the cryptographically secure random number generator built into your browser and seeded by your device's operating system. Nobody, including ChalkSpin, can predict or steer the result.

Can someone rig the wheel?

No. There is no hidden setting, secret weight or 'next winner' option. The only things that change the odds are visible to everyone: an entry's weight (its slice gets wider), duplicate entries (ChalkSpin flags them) and removing names. Anyone who opens the share link sees exactly the same entries and weights.

Does the spin length or the animation change the result?

No. The winner is chosen the instant you press Spin, before the wheel starts to move. Spin length, the number of turns, the theme, sounds and confetti only change how the result is shown.

Why did the same name come up twice in a row?

Because every spin is independent, repeats are normal. With 25 names there is a 1 in 25 (4%) chance that the next spin picks the same name again, and across 10 spins there is about an 88% chance that at least one name comes up twice. Turn on Remove winner if you want everyone to get a turn before anyone repeats.

How do weights work?

A weight multiplies an entry's chance. Type *2 after a name (for example 'Maya *2') or use the weight buttons, and that entry gets a slice twice as wide and exactly twice the chance. Each entry's chance is its weight divided by the total weight, which is the same as its share of the wheel.

Does ChalkSpin pick the winner on its server or see my list?

No. The draw runs entirely in your browser; no request is sent to choose a winner. Your list stays in your browser unless you save it to an account, and share links carry the entries after the # in the link, which browsers never send to a server.

Is Instant result less random?

No. Instant result uses exactly the same draw and simply skips the animation. ChalkSpin switches it on automatically when your device asks for reduced motion.

Is the random number generator really random?

It uses the same cryptographic generator as the wheel. Every whole number in your range has exactly the same chance, because ChalkSpin uses rejection sampling to remove modulo bias, and the no-repeats mode never draws a number twice until you reset.

Last reviewed Checked against ChalkSpin's shared randomness code and the W3C Web Crypto standardSpotted a problem? Tell us