Random Number Generator — Dice, Coin Flip & UUID
Cryptographically secure random numbers, dice rolls, coin flips, list picks and UUID v4 — all in your browser, using crypto.getRandomValues.
crypto.getRandomValueswith rejection sampling to remove modulo bias. That's cryptographic-grade randomness — fairer than physical dice.About this tool
Most random-number tools online use Math.random, which is fast but biased and predictable from seed. We use crypto.getRandomValues throughout — the same source the browser uses for cryptographic keys. On top of that, we use rejection sampling to avoid the "modulo bias" that creeps in when you naïvely take `random % range`: without it, a 32-bit value mapped to 1-100 has slightly higher probability for low numbers. With rejection sampling, every value is exactly equally likely.
Five tabs cover the common cases. The number-range tab handles "pick 5 numbers between 1 and 50, no duplicates". Dice supports the full D&D set plus custom sides and count, with individual rolls and the sum. Coin flip animates a real flip and keeps a history. Pick from list takes one item per line and either picks one or shuffles the whole list (Fisher-Yates). UUID generates v4 IDs via crypto.randomUUID.
Everything runs locally — no network calls, no logging.
How to use it (5 steps)
- Choose a tab. Number range, Dice, Coin flip, Pick from list, or UUID v4 — switch any time.
- Set parameters. For a range: min, max, count, allow duplicates. For dice: pick D4/D6/D8/D10/D12/D20 or set custom sides and count. For lists: paste one item per line.
- Tap Generate / Roll / Flip / Pick. Output appears instantly with a brief animation. Each result uses crypto.getRandomValues for true randomness.
- Read the output. Lists show every value; dice show individual rolls and the sum; coin shows heads/tails plus history; UUID shows a fresh v4.
- Copy or re-roll. One-tap copy of any output. Re-roll as many times as you want.
Frequently asked questions
+−What's the difference between cryptographic and pseudo-random?
Pseudo-random (Math.random) uses a deterministic algorithm seeded from time — fast, but predictable if you know the seed. Cryptographic random (crypto.getRandomValues) is sourced from operating-system entropy and is unpredictable even to the user. We use the crypto API throughout, so dice rolls, coin flips and number picks are genuinely unpredictable.
+−Is this fair?
Yes — and provably so. We use rejection sampling on top of crypto.getRandomValues to avoid the modulo bias that affects naïve `random % range` code. Every value in the chosen range has exactly equal probability. The same approach is used in security-grade lottery systems.
+−Can I trust the dice rolls?
For tabletop RPGs, board games and casual fun: absolutely yes. The randomness is stronger than physical dice (which have manufacturing imperfections). For high-stakes uses (gambling, audited drawings) you should use a regulated provider — we don't certify or audit.
+−Why use crypto random for dice — isn't that overkill?
Crypto random is only marginally slower than Math.random in modern browsers, and it's the right default. Math.random has known bias and predictability quirks; for any tool that affects outcomes (even casual ones), crypto is the cleaner choice. There's no downside.
+−How are UUIDs generated?
We use crypto.randomUUID() when available (all modern browsers since 2022), which produces a v4 UUID — 122 random bits with 6 fixed bits identifying the version. The probability of collision across the lifetime of the universe is negligible.
+−What's pick-from-list good for?
Drawing winners from a giveaway list, picking a restaurant from your shortlist, choosing who buys lunch, randomising interview order — anywhere you have a finite list of options and want one (or all of them, shuffled). Just paste one item per line.
+−Is anything saved or sent anywhere?
Nothing. Every roll, flip and pick happens locally in your browser. We don't log inputs, outputs, or that you visited the page (beyond standard server access logs).
Related on WRRK Tools
Strong random passwords with entropy meter
Tool% of X, X is what % of Y, increase/decrease
ToolFinal price after % off + savings
CategoryBrowse the full developer tools category
ArticleJSON formatting is essential for debugging and readability. Discover how to format JSON online quickly using free tools and best practices.
CompareHonest comparison: features, pricing, signup