Tool · Fun & random
Random Number Generator
A random number between two values, a handful of dice, a coin flip or a list in a new order – all with the same fair randomness from your browser.
What the generator does
- Number: one or up to 1,000 random numbers between two whole numbers, optionally without repeats (each number at most once, as in a draw) and sorted.
- Dice: up to 100 dice at once, from d4 to d100, with the total. “d20” means a die with 20 sides, as used in tabletop role-playing games.
- Coin: one flip for a quick decision, or many to see how heads and tails even out over time.
- Shuffle a list: names, tasks or words in a random order, for example for the order of talks or a starting line-up.
Prefer a wheel and a bit of suspense? Try the wheel spinner. To pick who does the washing-up or to split a group into teams, use the random name picker.
Where the randomness comes from
A computer is deterministic: the same input gives the same result. For randomness it needs a source it cannot work out itself. Operating systems collect unpredictable events for this – the exact timing of key presses, network packets and disk access, plus hardware random number generators in the processor – and mix them into a pool from which a cryptographic random number generator produces numbers.
A web page reaches that pool through the Web Crypto API with crypto.getRandomValues.
This generator uses it for every number, every die and every coin flip. The better-known
Math.random is meant for animations and games: it is fast, but the standard does not
require it to be unpredictable.
Fair means: no modulo bias
The source delivers whole numbers from 0 to 2³² − 1, so 4,294,967,296 different values. A die only needs six. The usual trick, “remainder after dividing by 6, plus 1”, has a catch: 4,294,967,296 is not divisible by 6. There is a remainder of 4 – so the faces 1 to 4 would each come up once more often than 5 and 6.
With 2³² values the effect is tiny. It becomes clear if you work it through with a single byte, which only has 256 values (0 to 255):
- 256 ÷ 6 = 42 remainder 4. The largest multiple of 6 below 256 is 42 · 6 = 252.
- Without rejection the values 252 to 255 land on faces 1 to 4. Those faces then get 43 of the 256 values each (16.8 %), while 5 and 6 get only 42 (16.4 %).
- With rejection any value from 252 upwards is thrown away and drawn again. What remains is 0 to 251, and each face gets exactly 42 of 252 values – precisely 1/6.
“Without repeats” works the same way: each new number is drawn fairly; if it is already there, it is thrown away and drawn again – like a ball that does not go back into the drum. To shuffle a list the tool uses the Fisher–Yates method in Durstenfeld’s version: working from the back to the front, each entry swaps with a fairly chosen entry before it (or with itself). Every possible order is equally likely.
Flip a coin: what to expect
Each flip is heads or tails with a chance of exactly 1 in 2, regardless of what came before. Over many flips the share of heads moves towards 50 %, but short streaks are normal: in ten flips, the chance of getting exactly five heads is only 252 ÷ 1,024 ≈ 24.6 % – the number of ways to choose five flips out of ten (252) divided by all 2¹⁰ = 1,024 possible sequences.
Limits of this tool
- No passwords or keys. The numbers do come from a cryptographic source, but they then appear on a page with ads and analytics. Generate passwords in your password manager instead.
- No edge in games of chance. No generator makes lottery numbers more likely to win.
- No verifiable draw. The result can be redrawn as often as you like and is not recorded anywhere. Prize draws need a procedure you can document afterwards.
- Whole numbers up to 10¹⁵, at most 1,000 numbers, 1,000 coin flips or 100 dice at once.
Privacy: the generator runs entirely in your browser. What you enter and the
results are not sent to xmoo.app or anyone else. The share link for a list contains the entries
after the # in the address; browsers do not send that part to the server, and the tool
removes it from the address bar after opening.
Sources
crypto.getRandomValues: W3C, Web Cryptography API;Math.randomwithout any unpredictability requirement: ECMAScript standard, Math.random- Rejection instead of remainder: Daniel Lemire, Fast Random Integer Generation in an Interval, ACM TOMACS 29 (2019)
- Shuffling: Richard Durstenfeld, Algorithm 235: Random permutation, Communications of the ACM 7 (1964)
Page last updated: 30 October 2026