Why Math.random() Isn't Random Enough
Most "random number generator" scripts on the web are built on Math.random(). It's fine for shuffling a deck of cards in a casual game, but it's a pseudo-random algorithm seeded from a predictable internal state — not suitable for anything where fairness actually matters, like picking a raffle winner or generating a security-sensitive value.
ToolLance's Random Number Generator uses crypto.getRandomValues() from the Web Crypto API instead — seeded by your operating system's hardware entropy source — with rejection sampling to eliminate the modulo bias that affects naive implementations. That's the same class of randomness used to generate cryptographic keys.
How to Roll Dice Online
Open the 🎲 Dice tab, choose your dice type — d4, d6, d8, d10, d12, d20, or d100 — set how many dice to roll and any modifier (e.g. +3 for a skill bonus), then click Roll. Each die shows individually, with natural 1s highlighted in red and maximum rolls in orange, plus the running total. It's built for tabletop and D&D sessions where you need a quick, fair roll without digging out physical dice.
How to Flip a Coin Online
The Special tab includes a coin flip generator — single flips or a batch of up to 100 at once, with a running heads/tails count. Useful for settling a quick decision or running a probability experiment where you want to see the actual distribution over many flips.
How to Pick a Random Winner From a List
Running a giveaway or raffle? Go to the Special tab and find "Random from List." Paste your entries one per line — names, ticket numbers, whatever you're drawing from — set how many winners to pick, and click Pick. When picking more than one winner, selections are made without replacement, so nobody gets picked twice.
How to Generate Lottery Numbers (Powerball, Mega Millions & More)
The 🎰 Lottery tab has the official rules for major lotteries pre-configured, so you don't have to remember them:
- Powerball — 5 numbers from 1–69, plus 1 Powerball from 1–26
- Mega Millions — 5 numbers from 1–70, plus 1 Mega Ball from 1–25
- EuroMillions, UK Lotto, Canada 6/49, OZ Lotto — regional rules built in
- Custom lottery — set your own pick count and number range
Numbers are drawn without replacement, exactly matching how a real lottery machine works — no number repeats within a single draw.
Random Numbers Without Repeats
In the Multiple tab, check "No duplicates (unique)" before generating to avoid repeats within your result set. If you need every integer in a range exactly once — for example, shuffling numbers 1–30 for a raffle — use the Sequence tab instead, which shuffles the entire range with zero repeats.
Other Generators Worth Knowing About
The same tool also includes a few generators that solve less common but genuinely useful problems:
- UUID v4 — RFC 4122-compliant unique IDs, crypto-seeded, useful for database keys or session tokens
- Weighted random — assign a different probability to each option, useful for loot tables or A/B test splits
- Gaussian (normal) distribution — numbers clustered around a mean, useful for generating realistic test data
- Random date and random hex color — quick generators for scheduling and design work
Frequently Asked Questions
Is an online random number generator actually random?
It depends on the source. Math.random() is not cryptographically secure. ToolLance uses crypto.getRandomValues(), seeded by your operating system's hardware entropy, with rejection sampling to eliminate modulo bias.
How do I roll a dice online?
Open the Dice tab, choose your dice type (d4–d100), set the count and any modifier, then click Roll. Each die shows individually.
How do I pick a random winner from a list of names?
Use the Special tab's "Random from List" — paste entries one per line, set how many to pick, and click Pick. No repeats when selecting multiple winners.
Can I generate Powerball or Mega Millions numbers?
Yes — the Lottery tab has the official rules pre-configured for Powerball, Mega Millions, EuroMillions, and several national lotteries, plus a custom option.
How do I generate random numbers with no duplicates?
Check "No duplicates (unique)" in the Multiple tab, or use the Sequence tab to shuffle an entire range with zero repeats.
What is a weighted random generator used for?
It assigns different probabilities to different outcomes — useful for loot tables, A/B test traffic splits, and probability simulations.
