πŸ“How the Randomness Works

βœ“ Tested & verified Updated:

Every tool on this site is built on the same four decisions: a cryptographically secure source, a bias-free way of fitting that source to a range, a provably uniform shuffle, and a Secret Santa draw that cannot produce a self-match. Nothing runs on a server.

The source: crypto.getRandomValues

All randomness here comes from crypto.getRandomValues, the Web Cryptography API’s cryptographically secure pseudo-random number generator, seeded by your operating system. It is the same generator browsers use for encryption keys and password generation.

We never use Math.random. That function is a fast, deterministic algorithm designed for animation and simulation; given enough consecutive outputs, its internal state can in principle be recovered and its future values predicted. For a draw with a prize at the end of it, that is the wrong property to have, and the secure alternative costs nothing.

Fitting the source to a range: rejection sampling

Getting unpredictable bits is the easy half. Squeezing them into a range without skewing them is where most generators quietly go wrong.

Take a random byte β€” a value from 0 to 255 β€” and reduce it to a six-sided die with % 6. It looks correct and it is not. 256 divided by 6 is 42 remainder 4, so:

ResultByte valuesCountProbability
0, 1, 2, 343 values each4316.80%
4, 542 values each4216.41%

A uniform die gives every face 16.67%. Here four faces are about 2.4% more likely than the other two β€” invisible over ten rolls, unmistakable over a million, and in a draw it means the entries at the top of your list are quietly favoured.

Rejection sampling removes it. 252 is the largest multiple of 6 that fits inside 256, so we accept byte values 0 to 251 and redraw whenever we get 252 to 255. That discards 4 values in 256 β€” about 1.6% of draws β€” and what remains divides perfectly evenly. Every range on this site is built this way, whatever its size.

Shuffling: Fisher–Yates

Anything that produces an order rather than a single pick β€” the list randomizer, the team generator, the card deck behind random card, the Secret Santa chain β€” is shuffled with Fisher–Yates.

The procedure is one backwards pass: at each position, swap the item with one chosen uniformly from the positions at or before it, using an index drawn as described above. Published by Fisher and Yates in 1938 for shuffling by hand, given its modern in-place form by Durstenfeld in 1964 and documented by Knuth in The Art of Computer Programming, it has the property that matters: every possible ordering of the list is exactly as likely as every other. Six items give 720 orderings, ten give 3,628,800, and the shuffle draws between them evenly.

The tempting alternative β€” sorting a list with a random comparator β€” is measurably non-uniform and looks perfectly shuffled while being wrong, which is what makes it dangerous.

Secret Santa: a single cycle

The Secret Santa generator shuffles the participants and then reads the shuffled list as one closed chain: the first person gives to the second, the second to the third, and the last gives back to the first.

This makes self-matches structurally impossible rather than filtered out, which matters because the naive approach fails often. The probability that a random pairing leaves nobody holding their own name is about 36.8% β€” the derangement probability, converging on 1 divided by e β€” so roughly two draws in three would need redoing. A chain never needs redoing. For n participants there are (nβˆ’1)! possible chains, which is 5,040 for a group of eight.

Why the animation cannot change the result

On every tool with a spin, roll or flip, the outcome is drawn the instant you press the button. The animation is then rendered to land on the result that has already been chosen.

Nothing about how long the wheel turns, where it started, how hard it was flicked or whether you reduced motion in your system settings can influence the outcome β€” with reduced motion enabled, the result simply appears without the theatre, and it is drawn identically either way. This is worth stating plainly because the opposite arrangement, where a physics animation determines the winner, is both slower and far easier to get subtly wrong.

Privacy: nothing leaves the browser

There is no server component. Your entries are read from the page, the draw happens on your device, and the result is displayed and then forgotten. Nothing is stored, logged or uploaded, and there is no history to recover.

The one place your data persists is the page address: entries are mirrored into the URL so a wheel can be bookmarked or shared. That address lives on your device unless you send it to someone, and it is the only copy of a wheel that exists.

Sources

Weekly lucky numbers

Weekly

A fresh line for the draw you play, every week, with the seed so you can check we did not cherry-pick it.

Free, no account. One click unsubscribes and deletes your address.