What RandomBench does
Seven tools, each on its own page, so you can bookmark the one you need:
- Coin: a 3D flip, a count of heads and tails for this session, the current run, and series of up to 100,000 flips at once.
- Dice: 1–20 dice of d4, d6, d8, d10, d12, d20 or d100, or any roll in tabletop notation, with the total and every die shown.
- Numbers: any range, negative or huge, with or without repeats, sorted or not, whole or with decimal places, plus lottery presets.
- Giveaway: winners and reserves from a list of up to 100,000 entries, in rounds, with a drum that announces each winner and a result anyone can check.
- Teams: shuffle a list, or split it into a number of teams or teams of a given size, as evenly as possible.
- Wheel: your own options with colours and weights, and a spin that slows down like a real wheel.
- Yes/no, cards & more: yes or no, rock-paper-scissors, a card from a 52- or 54-card deck, a random letter, a colour in HEX and RGB, a date between two dates.
Press Space or Enter anywhere outside a text field to go again. The speaker button turns on short sounds (off by default), phones give a short vibration with each result, and the full-screen button leaves only the result and the main button on screen, large enough for a projector or a stream. With “reduce motion” turned on in your system, results appear at once without animation.
How to run a giveaway
- Add the participants, one per line: type them, press Paste, or open a
.txtfile or a.csvexport (the first column is used, for example the names or user handles). Spaces are tidied, empty lines are skipped and, with Remove duplicates on, a repeated name counts once, whatever its capital letters. The counter shows how many entries remain. Lists of 10,000 or 100,000 lines are fine. - Set the number of winners and reserves and, if you like, a title. Reserves are drawn after the winners, in order, for when a winner does not answer.
- Lock the list and publish the fingerprint (under Fair draw). RandomBench shows a 64-character SHA-256 fingerprint and a ready-made announcement. Post it where participants will see it, before the draw: in the giveaway post, a pinned comment or the stream chat.
- Draw. The drum flashes names and stops on each winner in turn; Skip animation or the Space bar shows them all at once. Next round, without the winners draws again from everyone who has not won yet.
- Share the link under the result. It carries the list, the seed and the public value, so anyone can repeat the draw on their own device.
You can also press Draw the winners straight away: the list is locked and the fingerprint made at that moment. The result is still repeatable from the link, but only a fingerprint published in advance proves that nothing was changed after the fact.
A locked draw is kept in this browser, so closing the tab does not lose a published fingerprint. Back up the seed (JSON) lets you finish the draw on another device: open the file with Import JSON and press Continue this draw here. Keep that file to yourself until the draw is over.
Why the organiser cannot rig it
The result of a RandomBench draw is not random at the moment you press the button: it is worked out from three things, and every device that knows them gets exactly the same winners.
- The list, in its order.
- The secret seed: 32 hexadecimal characters (128 bits) from the device’s cryptographic generator, or your own text.
- The public value, if you chose one: something that nobody knows yet when the fingerprint is published, such as the winning numbers of a lottery draw next Saturday or the closing figure of an index. Its description goes into the fingerprint; the value itself is typed in at the draw.
The fingerprint is SHA-256 of the title, the seed, the description of the public value and the whole list. SHA-256 works one way: from a fingerprint nobody can recover the seed, and nobody can find another list or seed with the same fingerprint. So:
- Participants cannot predict the winners before the draw: they do not know the seed.
- The organiser cannot add a friend, remove someone, reorder the list or swap the seed after publishing: the fingerprint would no longer match.
- With a public value the organiser cannot even try seeds in advance until a convenient one comes up, because the result also depends on a value that does not exist yet. Without one, an organiser who publishes the fingerprint still fixes the list, but could in theory have tried many seeds before publishing. For anything important, add a public value.
The draw itself: the fingerprint and the public value are hashed again with SHA-256 into a key for ChaCha20, a well-studied stream cipher (RFC 8439), which produces the random numbers. The winners are the first steps of a Fisher–Yates shuffle over the list, without bias. Each round uses its own key and excludes earlier winners.
How to verify a draw
- Before the draw, save the fingerprint the organiser published (a screenshot of the post is enough).
- After the draw, open the link the organiser shared. RandomBench recomputes everything on your device; the winners are not in the link at all.
- Paste the saved fingerprint into Fingerprint published before the draw. A green “Matches” means the list and the seed are exactly the ones that were announced; a red “Does not match” means something was changed.
- If there is a public value, check that it really is, say, the published lottery result for that date.
- Open All participants and check that your name is in the list.
You do not have to trust RandomBench either. The fingerprint is plain SHA-256 of the text described in the code comments of rng.js, so you can recompute it with any SHA-256 tool, and the hidden self-test at #/selftest checks the SHA-256 and ChaCha20 against their published test vectors.
Coin, dice and notation
A coin flip is decided before the coin starts turning; the 3D animation only shows it. A series reports heads and tails, the longest run and how unusual the split is: a fair coin lands more than two standard deviations from 50% in about 1 series in 20.
Dice accept the notation used in tabletop role-playing games. You can also pick a die, a number of dice and a modifier with the buttons.
| Notation | Meaning |
|---|---|
d20 | one twenty-sided die |
2d6+3 | two six-sided dice plus 3 |
4d6dl1 | four d6, drop the lowest (ability scores) |
2d20kh1 / 2d20kl1 | advantage / disadvantage: keep the highest / lowest |
d%, d100 | a number from 1 to 100 |
1d8+2d6-1 | several groups and a modifier |
k means kh and a bare d after the die means dl; the Ukrainian к works as well as d. One roll has up to 100 dice of 2 to 1000 sides. Dropped dice are shown struck through.
Numbers, teams and the wheel
- Numbers: the range can be negative and as large as 45 digits. With decimal places, every value of that grid is equally likely (0 to 1 with 2 places gives 0.00, 0.01 … 1.00). No repeats works on any range; asking for more different values than the range has gives an error instead of a hang. Up to 10,000 numbers at once. Lottery presets: 6/49, 6/45, 5/36, 5/50 + 2/12 and 5/69 + 1/26.
- Teams: the list is shuffled and dealt like cards, so team sizes never differ by more than one. “People per team” makes as many teams as needed: 10 people in teams of 3 gives four teams of 3, 3, 2 and 2.
- Wheel: a weight of 2 makes an option twice as likely as one with weight 1, and its slice twice as wide. The winner and the exact stopping point inside its slice are drawn first; the wheel then turns 5–7 times and slows down to land there. Turn on Remove the winning option to draw options one by one.
How the randomness works
Everything on the page goes through one small module. It reads random numbers only from crypto.getRandomValues, the browser’s cryptographic generator, never from Math.random.
The common shortcut for “a number from 1 to n” is to take a random 32-bit number and keep the remainder of dividing it by n. Unless n divides 232 exactly, small results then come up slightly more often. RandomBench throws away the numbers from the incomplete top part of the range and draws again (rejection sampling), so every result is exactly equally likely, for 3 as for 1,000,001 or a 30-digit range. Lists are shuffled with the Fisher–Yates algorithm on the same generator.
The hidden self-test, #/selftest, checks this on your device in a couple of seconds: a million coins and a million d6 with a χ² test, the awkward ranges 1–3, 1–1,000,001 and 1–3,000,000,000, shuffles, a 1030 range and the reproducibility of a draw. Next to the 3,000,000,000 test it shows the χ² of the naive remainder shortcut on the same data: tens of thousands, a clear fail.
Privacy
- Nothing you enter is sent anywhere: apart from the anonymous visit statistics of the whole site (no cookies, without the part of the address after #), the page makes no requests and works offline once installed.
- Lists, settings and a draw in progress are kept in this browser’s storage. Results go to the history only when you save them, except giveaways, which are saved automatically so a draw is never lost.
- A shared link carries what is needed to show or repeat the result: for a giveaway, the whole list of participants. Share it only if the participants agreed to be listed; use handles rather than full names and contact details.
- A draw is not shared before it is held: until then the link would reveal the seed.
Limitations
- A link to a big list is long. 10,000 names make a link of several tens of kilobytes, which messengers may cut. Send the JSON file instead, or publish the list elsewhere along with the fingerprint.
- Shared coin, dice and number results are records, not proofs: anyone could have flipped many times and shared the result they liked. Only a giveaway with a fingerprint published in advance is verifiable.
- A giveaway without a public value fixes the list and the seed, but cannot prove that the organiser did not try several seeds before publishing.
- Up to 100,000 entries of up to 200 characters each, 100 dice per roll, 10,000 numbers and 5,000 names for teams.
Frequently asked questions
Is a computer coin flip really 50/50?
Yes. Each flip takes a uniform random bit from the cryptographic generator, and the self-test checks a million flips. A real coin is, if anything, slightly less fair.
Can I prove to my followers that the giveaway was fair?
Yes: lock the list, publish the fingerprint before the draw (ideally with a public value such as next week’s lottery numbers), then share the result link. Anyone can recompute the winners and compare the fingerprint.
Why do the same list and seed always give the same winners?
That is the point: the draw is a calculation, so it can be checked. The unpredictability comes from the secret seed and the public value, which nobody knows in advance.
What if a winner does not reply?
Draw a few reserves together with the winners; they are taken in order. Or run another round, which excludes everyone who has already won.
Does it work without the internet?
Yes. After the first visit the page is cached, and it can be installed as an app from the browser menu.