πŸ”’Numbers, Letters & Words

Generators for the things that come in sets β€” a number from any range, a lottery line, a letter, a word.

βœ“ Tested & verified Updated: How the randomness works

These are the generators that scale. A wheel is the better instrument up to about forty options, because people can see the slices; past that you want a number, and a number works just as well for four hundred entrants as for four.

The random number generator is the workhorse β€” any inclusive range, any quantity, with switches for no-duplicates and sorted output. The lottery number generator is the same draw shaped to a ticket, with main balls and bonus balls from separate pools, and an honest note about what a 1-in-13,983,816 chance means. The random letter generator gives a flat 3.85% to each of the 26 letters, which is fair to the alphabet and occasionally cruel to whoever draws a Z. And the random word generator hands out nouns, verbs and adjectives for charades, pictionary and stuck writing.

The shared detail underneath all four is rejection sampling. Squeezing random bytes into a range with a plain remainder quietly favours the low end; discarding the leftovers and drawing again does not. It costs a few wasted bytes and buys a generator that is actually uniform β€” which is the whole subject of how random is random.

Frequently asked questions

Which generator do I need for a giveaway?

The random number generator. Number your entrants from 1 upwards, set the range to match, and draw once on camera with the numbered list published beforehand. It scales to any size, which a wheel does not β€” past about forty entries the labels stop being readable, and past a few hundred a wheel is unfilmable.

What is modulo bias and why does it matter here?

It is the small skew you get from squeezing random bytes into a range with a remainder. Reduce a byte from 0 to 255 with % 6 and the values 0 to 3 arise 43 times out of 256 while 4 and 5 arise only 42, so low results come up about 2% too often. Every generator here uses rejection sampling instead, which removes the skew entirely.

How do I stop the same value appearing twice?

The number generator has a unique switch, which draws without replacement so a set of five numbers is five different numbers. The lottery generator always draws that way, since balls do not go back in the drum. Letters and words are drawn independently every time, so repeats there are expected β€” draw again if a duplicate spoils the prompt.

Do these pages send anything to a server?

No. Every generator here runs in the page, including the word list, which ships with it rather than being fetched. Numbers, letters and words are produced locally, displayed, and forgotten as soon as you draw again. Nothing is stored, nothing is uploaded and no record exists of anything you have generated.

How the randomness works

All four generators draw from crypto.getRandomValues, the browser’s cryptographically secure random number generator, and map values into range with rejection sampling rather than a modulo β€” discarding the leftover values that would otherwise make the low end of a range marginally more likely. Draws marked unique, and every lottery line, sample without replacement, so no value can repeat within a set. Letters and words are drawn independently each time. Nothing is seeded from the clock, nothing persists between draws, and no result is stored or transmitted. The longer explanation lives on the methodology page.

Sources:

More ways to leave it to chance

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.