D20 Dice Roller
A single d20 returns a whole number from 1 to 20, and each face is equally likely at a 5 percent chance per roll. This d20 dice roller gives you an instant result with one click, so you can resolve an attack, a saving throw, or a skill check without hunting for a physical die. You can also roll several dice at once and add a flat modifier, which matches the way most tabletop rules describe a roll such as 2d6+3. Every roll shows the individual dice, the raw sum, and the total after the modifier, so nothing about the result is hidden.
Quick answer
Dice notation is written as NdX+M, where N is the number of dice, X is the number of sides on each die, and M is a modifier added at the end.
Click Roll to generate a d20 result.
What this tells you
- •Dice notation is written as NdX+M, where N is the number of dice, X is the number of sides on each die, and M is a modifier added at the end.
- •For a plain d20, N is 1, X is 20, and M is 0, so the notation is simply 1d20 or d20.
- •A roll written as 3d6 means roll three six-sided dice and add the three results together for a value from 3 to 18.
- •A modifier shifts the whole result up or down after the dice are added, so 1d20+4 produces a value from 5 to 24.
- •The number of dice controls the shape of the outcome. One die is flat and even, while several dice cluster their totals toward the middle.
- •This roller reports the sum before the modifier and the total after it, which keeps the math clear when you compare a raw roll against a target number.
- •Results come from pseudo-random browser logic, which is fine for games and lessons but not for security or wagering.
How to Use
- 1Set the number of dice you want to roll. Leave it at 1 for a standard single d20 check.
- 2Enter a modifier if your rule or bonus calls for one. Use 0 when no bonus or penalty applies, and use a negative number for a penalty.
- 3Note that each die is fixed at 20 sides, so every roll on this page is a true d20 labeled clearly for you.
- 4Click the Roll button to generate a fresh result. The tool lists each individual die, the sum of the dice, and the total after the modifier.
- 5Roll again as many times as you need. Every click starts a new independent draw, so past results do not affect the next one.
How It Works
Formula
roll = Math.floor(random() * sides) + 1, total = sum(rolls) + modifierEach die uses the same core step. The function random() returns a decimal from 0 up to but not including 1. Multiplying by the number of sides spreads that decimal across the full face range, Math.floor drops the fractional part to leave a whole number from 0 to sides minus 1, and adding 1 shifts the range so the lowest face is 1 and the highest face equals the number of sides. For a d20 this yields a whole number from 1 to 20. When you roll more than one die, the tool repeats that step for each die and adds the results into a sum, then adds your modifier to produce the total. The expected value of one fair d20 is 10.5, found by adding 1 through 20 to get 210 and dividing by 20. That average is why a long series of d20 rolls tends toward 10.5 per die even though any single roll can land anywhere from 1 to 20.
Calculation note: values are processed in the order shown above, using the current input units.
Worked Examples
Roll one d20 for an attack
A single d20 with no modifier returns any whole number from 1 to 20. Each of the 20 faces has the same 5 percent chance, and the sum equals the total because the modifier is 0.
Roll a d20 with a plus 5 skill bonus
The die still lands from 1 to 20, then the plus 5 modifier is added to the total. That shifts the possible outcome to a value from 6 to 25 while the raw sum stays between 1 and 20.
Roll two d20 for advantage style comparison
Rolling two d20 gives two separate faces, each from 1 to 20. The sum ranges from 2 to 40, and the roller also shows the highest single die so you can pick it if your rule keeps the better roll.
Roll a d20 with a minus 2 penalty
The die returns 1 to 20, then the minus 2 penalty lowers the total. The result can be as low as -1 when the die shows 1 and as high as 18 when the die shows 20.
Roll four d20 for a quick average check
Four d20 produce four faces from 1 to 20 each. The sum ranges from 4 to 80, and the average per die shown by the tool should sit near 10.5 over many repeated rolls.
Average and range for common dice
Expected value and possible range for a single roll of each standard die.
| Die | Range | Average per roll |
|---|---|---|
| d4 | 1 to 4 | 2.5 |
| d6 | 1 to 6 | 3.5 |
| d8 | 1 to 8 | 4.5 |
| d10 | 1 to 10 | 5.5 |
| d12 | 1 to 12 | 6.5 |
| d20 | 1 to 20 | 10.5 |
| d100 | 1 to 100 | 50.5 |
The average of a fair die equals (sides plus 1) divided by 2. For a d20 that is (20 plus 1) divided by 2, which is 10.5.
Why the d20 average is 10.5
A fair d20 has 20 faces numbered 1 through 20, and each face is equally likely. To find the expected value you add every face and divide by the count of faces. The sum of 1 through 20 is 210, and 210 divided by 20 is 10.5. Half the faces are 10 or below and half are 11 or above, so the balance point sits between 10 and 11.
A single roll never actually lands on 10.5 because the die only shows whole numbers. The 10.5 figure is the long run average, meaning that if you roll a d20 many times the mean of your results should drift close to 10.5. Short runs can look lopsided with clusters of high or low rolls, which is normal for random data.
This is why a modifier matters so much in games. Adding a plus 3 bonus shifts the expected total to 13.5, which noticeably raises your odds of beating a fixed target number without changing the shape of the single die.
Common mistakes
- Thinking a d20 excludes 1 or 20. Both endpoints are valid, so a natural 1 and a natural 20 are each real 5 percent outcomes.
- Confusing the sum with the total. The sum is the dice added together, while the total includes your modifier on top.
- Expecting the average of a few rolls to equal 10.5 exactly. That average only appears over many rolls, not a handful.
- Adding the modifier to every die instead of once. A roll of 2d20+3 adds 3 a single time to the combined sum, not 3 to each die.
- Using this roller for anything that needs secure randomness. It suits games and lessons, not passwords, tokens, or wagering systems.
Embed this calculator on your site
Drop this single line where you want the calculator to appear. It is responsive, mobile-friendly, resizes automatically, and is free to use with attribution.
<script src="https://calctide.com/embed.js" data-tool="d20-dice-roller" async></script>Preview the embed at /embed/d20-dice-roller/.