Overview
What this generator does
This is four random tools in one: a random number generator with range and uniqueness control, a dice roller for tabletop games, a coin flipper, and a list picker for raffles and giveaways. Every result uses your browser's cryptographically secure random source with rejection sampling to eliminate bias — fair enough for real draws, not just casual use.
How it works
True randomness vs pseudo-randomness
Computers can't produce truly random numbers from nothing — they use algorithms. The question is how good the algorithm is.
Math.random() — not good enough for draws
The standard Math.random() is a pseudo-random generator optimized for speed, not fairness or unpredictability. It's fine for animations and games, but its output can be predicted and its distribution isn't guaranteed uniform.
crypto.getRandomValues() — what we use
This generator uses your browser's cryptographically secure pseudo-random number generator (CSPRNG), seeded by your operating system's entropy pool (hardware noise, timing jitter, etc.). It's the same source used to generate encryption keys. Combined with rejection sampling, every number in your range is exactly equally likely.
Why fairness needs care
What is modulo bias?
The naive way to get a number in a range is random % range. The problem: unless the range divides evenly into the random source's full span, some outcomes become slightly more likely than others.
Imagine a random source that produces 0-9, and you want 0-2. Using modulo: 0,3,6,9 → 0; 1,4,7 → 1; 2,5,8 → 2. So "0" appears 4 times out of 10, while "1" and "2" each appear 3 times. That's a 33% bias toward 0. For a fair raffle, that's unacceptable.
How we fix it
What's included
The four modes
Numbers
Any range, any count. Toggle 'no duplicates' for unique results (lottery-style) and 'sort' to order them.
Dice
d4, d6, d8, d10, d12, d20, d100. Roll up to 50 at once, see individual results and the total. Built for D&D and board games.
Coin flip
One flip or hundreds. Multiple flips show the heads/tails tally — useful for probability demonstrations.
List picker
Paste names one per line. Pick a single random winner, or shuffle the whole list to show a fair, complete ordering.
Real-world applications
Common uses
- Giveaways and raffles — pick a fair winner from entrants
- Classroom — randomly select a student to answer
- Team selection — shuffle a roster into random groups
- Tabletop gaming — roll dice without physical dice
- Decision making — coin flip for a 50/50 choice
- Sampling — pick random rows or records for a spot check
- Secret Santa — shuffle names for gift assignments
- Contests — generate a random winning number
Behind the scenes
Privacy and how it runs
Everything runs in your browser
Common questions
Is this random enough for a giveaway?
Yes. The crypto-secure source plus rejection sampling gives a provably uniform distribution. For maximum transparency in a public draw, use the list picker's 'shuffle whole list' option and screen-record the result so entrants can see the complete random ordering.
Can I generate numbers without repeats?
Yes — check 'No duplicates'. If you request more unique numbers than the range contains (e.g., 10 unique from 1-5), it returns the maximum possible without repeating.
How many numbers can I generate at once?
Up to 10,000 in a single batch. For unique numbers across very large ranges, the generator switches to an efficient set-based method to stay fast.
What dice are supported?
The standard polyhedral set: d4, d6, d8, d10, d12, d20, and d100 (percentile). Roll up to 50 dice at once with an automatic sum — handy for tabletop RPGs.
Is a coin flip really 50/50 here?
Yes. We map the secure random source to exactly two equally likely outcomes with no bias. Over many flips you'll see the tally converge toward 50/50, with normal short-run variance.