Dice Roller Calculator

Dice Roller

Roll any dice in standard notation, such as 1d20 or 4d6+2, with a fair random generator, and watch your results line up with the expected spread as the rolls add up.

Each face: chance 1 ÷ S

NdS means N dice with S sides; add modifiers with + and −, such as 1d20 + 5.

Type the dice you want to roll

What is a Virtual Dice Roller?

A virtual dice roller picks each face at random with exactly equal chances, standing in for physical dice. It's handy for online games, odd dice you don't own (a d7 or d30), or rolling a hundred times in a second.

Rolling many times also makes it a hands-on way to see probability work. A handful of rolls can look lopsided, but as the count grows your average closes in on the expected value and the shape of your results matches the theory.

Each roll is independent. A run of low numbers doesn't make a high one more likely next time, any more than it would with real dice.

How the Dice Roller Picks a Number

Uses the browser's Web Crypto random generator, as specified by the W3C. See Sources.

1. Draw a secure random number

v = a random whole number from 0 to 4,294,967,295

2. Throw away the uneven tail

If v ≥ ⌊2³² ÷ S⌋ × S, draw again

Without this step some faces of a d6 or d20 would come up very slightly more often than others.

3. Map to a face

face = (v mod S) + 1, each with chance exactly 1 ÷ S

Worked Example: 100 Rolls of 2d6

Given:
Roll 2d6 a total of 100 times. What should the results look like?
Step 1:
Expected average and spread of one roll:
average 7 · SD 2.42
Step 2:
How much the average of 100 rolls wobbles:
2.42 ÷ √100 = 0.24 → usually 6.5 to 7.5
Step 3:
Expected count of 7s:
100 × 6/36 ≈ 17, but anything from about 10 to 24 is normal
Result:
An average within about 7 ± 0.5

Press Roll 100 with 2d6 and compare. The blue bars in the chart wander around the grey expected ones and settle down as you keep rolling.

Dice Notation at a Glance

The notation used in tabletop games and accepted by this roller.

Examples of dice notation
TypeMeansRange
d20One twenty-sided die1–20
3d6Three six-sided dice, added3–18
1d8+3One eight-sided die plus 34–11
2d6+1d4Two d6 and one d4, all added3–16
1d20-2One d20 minus 2-1–18
d100A percentile roll, 1 to 1001–100

Common Dice Roller Mistakes

  • Judging fairness from a few rolls. Ten rolls of a d20 without a single 20 happens about 60% of the time. You need hundreds of rolls to spot a real bias.
  • Expecting the results to "even out" soon. Averages settle slowly, at a rate of 1 ÷ √n. The counts of each face never need to equalise exactly.
  • Using Math.random-style shortcuts for big dice. Taking a random number modulo the number of sides without rejection makes some faces slightly more common. This roller avoids that.
  • Writing 2d6 when you mean 1d12. They have different shapes: 2d6 favours 7, while 1d12 is flat from 1 to 12.

Dice Roller FAQs

Is this dice roller truly random?

It uses the cryptographic random generator built into your browser, the same kind used for security keys. For games it’s as fair as dice can be.

Can I roll dice that don’t exist physically?

Yes. Any number of sides from 2 to 1,000 works, so a d7, d30 or d1000 is fine.

How many dice can I roll at once?

Up to 100 dice in total per roll, and up to 100 rolls with one press.

Why does my average differ from the expected one?

Random variation. With few rolls the gap can be large; it shrinks roughly with the square root of the number of rolls.

What happens to my history if I change the dice?

A new set of dice starts a fresh history, so the average and chart always compare like with like.

Can I roll with advantage?

Roll 1d20 twice with “Roll” and take the higher. Advantage raises the average from 10.5 to about 13.8.

Are my rolls stored anywhere?

No. Everything happens in your browser, and the history disappears when you leave the page.

How do I check if a real die is fair?

Roll it many times, count each face and compare with what this roller produces or with an equal share. A chi-square goodness-of-fit test gives a formal answer.

Sources

  • W3C, Web Cryptography API: getRandomValues.
  • D. E. Knuth, The Art of Computer Programming, vol. 2: Seminumerical Algorithms, 3rd edition (Addison-Wesley, 1997), chapter 3: random numbers.

Related Tools