Random number from 1 to 20
Twenty numbers at 5% each: a d20 roll, a class of 20, a quiz.
Between 1 and 20
No number drawn yet.
Tap Draw, or press Space
Range
Last draws
None yet. Your draws line up here, newest first.
- Free, no sign-up
- The result is drawn before anything moves
- Nothing leaves your browser
What it does
Tap Draw for a whole number from 1 to 20, each with exactly a 5% chance, the same as a fair twenty-sided die. Use it as a d20 in tabletop games, to call on one of twenty students, or to pick a question from a list of twenty. The number is drawn before the reels turn.
How to use it
- Tap Draw to roll from 1 to 20.
- Rolling twice? Set How many to 2 and keep the higher, or the lower.
- Calling on students? Turn on No repeats so nobody is picked twice in one go.
What people use it for
A d20 roll
Role-playing games that call for a d20 work just the same with a draw from 1 to 20. A 20 is 5%, and so is a 1.
Twenty students
Number the register and draw who reads next. Set How many to 20 with No repeats for the whole class in a random order.
Quiz night
Twenty questions on cards? Draw the one that comes next.
Odds from 1 to 20
| From 1 to 20 | Odds |
|---|---|
| Any one number | 1 in 20 (5%) |
| An even number | 10 in 20 (50%) |
| The top ten percent (19 to 20) | 2 in 20 (10%) |
| 15 or higher | 6 in 20 (30%) |
| At least one 20 in two rolls | 9.75% |
| A repeat within the first 6 draws | 56.4% |
| The average of many draws | 10.5 |
Rolling twice and keeping the higher roll nearly doubles your chance of a 20, from 5% to 9.75%. The average roll is 10.5, halfway between 1 and 20.
How it picks
The way the RandALL app does it: the number first, the reels after.
- Your range is read. Whole numbers up to 15 digits, negative or positive. A range typed backwards is turned round, so 100 to 1 means 1 to 100. Both ends can come up.
- The number is drawn first. For a range of n numbers, a whole number from 0 to n minus 1 is drawn with
crypto.getRandomValuesand added to your minimum. Rejection sampling throws away the few raw 32-bit values that would give some numbers an extra share, so each one has exactly a 1 in n chance. - Wide ranges get more bits. One 32-bit draw covers 4,294,967,296 numbers. For a wider range, two draws are joined into a number with just enough bits for it, and anything past the end is drawn again. No remainders, no rounding.
- No repeats is a fair set, then a shuffle. Floyd’s algorithm picks numbers that all differ, with every possible set equally likely, and a shuffle makes every order equally likely too.
- Then the reels turn. Each reel steps through the digits before its own, slowing as it goes, and they stop left to right, as in the app. They only show a number that is already decided.
Tested. In 100,000 test draws each from 1 to 10, 1 to 6 and minus 3 to 3, every number came up evenly (chi-square test). A range three times wider than 32 bits and the full 15-digit range split evenly into slices, odds and evens, and last digits. With No repeats no draw ever repeated, and all 20 ordered pairs from 1 to 5 and all 20 sets of three from 1 to 6 came up evenly.
More random tools
Questions
Is this a fair d20?
Yes. Each number from 1 to 20 has exactly a 1 in 20 chance, drawn with crypto.getRandomValues. A plastic d20 can roll unevenly if it is badly made; this cannot.
What are the odds of rolling a 20?
1 in 20, or 5%, on every roll. Roll twice and keep the higher, and the chance of at least one 20 goes up to 9.75%.
Can I roll several d20s at once?
Set How many, up to 50. Each number is its own roll. The dice roller also adds them up and takes modifiers like +5.
Take it with you
RandALL for iPhone has 25 tools in one app: wheels and teams, real 3D dice, random alarms, Finger Picker and more. It works offline.
Your first 24 hours are free, with every tool. After that, subscribe or buy the lifetime unlock once. Family Sharing included.
Get it on the App StoreiPhone only for now. These web tools are yours to keep using.
