Mathematics · Statistics
Random Number Generator & Dice Roller
Generate truly fair random numbers in your browser with the Web Crypto API: whole numbers in any range — with or without repeats, for lotteries and raffles — decimals, dice rolls in standard notation (d20, 3d6, 2d8+1), coin flips, or a random pick or shuffle of a list of names. Press Generate again for a fresh draw; nothing is stored.
Also listed inOther Calculators
Your inputs
Quick start — try a typical case
Numbers, rolls, flips or picks.
Your result Live
Whole numbers
Generating in your browser…
Press Generate again for a new draw
How this is calculated
Uniform choice by rejection sampling from crypto.getRandomValues — every outcome exactly equally likely
- No repeats
- A partial Fisher–Yates shuffle of the range
Each number is drawn with the browser's cryptographic random generator and rejection sampling, which avoids the small bias of the common 'random % n' shortcut. Lists are picked or shuffled with the Fisher–Yates method, so every order is equally likely. Dice notation like 3d6+2 means three six-sided dice added up, plus 2.
Assumptions & sources
- Randomness comes from your device's cryptographic generator; results are never sent or stored.
- 1Crypto.getRandomValues() — MDN Web Docs
- 2The Art of Computer Programming, Vol. 2 — random sampling and shuffling (Algorithm P) — D. E. Knuth, Addison-Wesley
Calculator ID MATH-RANDOM-001 · version 1.0.0
Common questions
Is this truly random?
It uses the same cryptographic generator browsers use for security keys, with unbiased sampling — fair enough for draws, games and statistics.
How do I pick lottery numbers?
Choose whole numbers, set the range (e.g. 1 to 49), how many (6), and turn on 'No repeats' and 'Sort'.
What does 2d6 mean?
Roll two six-sided dice and add them: totals from 2 to 12, with 7 the most likely.