Dice Roller & TTRPG Probability Calculator
Dice are one of the simplest ways to introduce controlled randomness into a game, but the mathematics behind a dice roll can become surprisingly rich.
A single d6 is easy:
Each face of a fair six-sided die has probability:
But once you start rolling several dice, adding modifiers, keeping the highest rolls, dropping the lowest die, exploding on maximum results, or comparing Advantage and Disadvantage, the distribution changes.
This Dice Roller & TTRPG Probability Calculator is designed for both sides of that problem:
- Roll the dice when you simply need a result.
- Analyze the dice when you want to understand the probability behind the result.
The calculator supports standard polyhedral dice, custom-sided dice, TTRPG notation, modifiers, keep-highest and keep-lowest mechanics, Advantage/Disadvantage-style rolls, exploding dice, percentile rolls, session history and probability visualization. Its internal testing covers exact distributions for advanced mechanics as well as secure random sampling.
How Dice Notation Works
The standard notation is:
where:
- N = number of dice
- M = number of sides on each die
For example:
means: roll two six-sided dice and add the results.
Similarly, 1d20 means one twenty-sided die, while 4d6 means four six-sided dice.
This general notation is used across many tabletop systems. For example, Pathfinder's rules also describe notation such as 4d6 as four six-sided dice.
The notation becomes more powerful when operators are added. Examples include:
The exact meaning of those modifiers depends on the dice notation supported by the calculator or the game system using the notation.
What Does 2d6 Mean?
When you roll 2d6, you get two independent results between 1 and 6.
The smallest possible total is 1 + 1 = 2. The largest is 6 + 6 = 12. So:
There are 6 × 6 = 36 equally likely ordered outcomes. That makes it possible to calculate the exact probability of every total.
For example, a total of 7 can happen in six ways:
Therefore:
The calculator's exact PMF regression verifies the 2d6 distribution and its 7-point peak.
Why 2d6 Forms a Bell-Shaped Distribution
A single d6 has a uniform distribution: every result is equally likely.
▉ ▉ ▉ ▉ ▉ ▉
But when two dice are added, middle totals have more combinations than extreme totals. That produces a triangular, bell-like peak:
Probability
/\
/ \
/ \
_____/ \_____
2 3 4 5 6 7 8 9 10 11 12The peak occurs at 7, while 2 and 12 are the rarest totals. This is why a pool such as 2d6 feels very different from a single d20 even though both involve familiar polyhedral dice.
Dice Probability Formula
For one fair n-sided die:
That means a d20 has P(X = k) = 1 / 20 = 5% for each individual face. A d100 similarly gives each integer from 1 through 100 a probability of 1%. The calculator's mathematical audit confirms these uniform-die relationships.
For probability problems that are not limited to dice, the Probability Calculator can handle the broader probability calculation.
Expected Value of a Die
The expected value of a fair n-sided die is:
- For a d6: E[X] = (6 + 1) / 2 = 3.5
- For a d20: E[X] = (20 + 1) / 2 = 10.5
These are averages over many rolls, not predictions of an individual roll. A single d20 can only produce integers 1, 2, ..., 20, so it cannot literally roll 10.5. Instead, over a very large number of fair rolls, the sample average approaches the theoretical expected value. The calculator independently verifies both values.
Variance of a Fair Die
Variance measures the spread of a random variable around its expected value:
- For d6: Var(X) = (36 - 1) / 12 = 35 / 12 ≈ 2.9167
- For d20: Var(X) = (400 - 1) / 12 = 399 / 12 = 33.25
The calculator verifies these analytic values as part of its mathematical regression.
Expected Value and Variance for Multiple Dice
For m independent identical n-sided dice:
For 3d6:
- E[S] = 3 × 3.5 = 10.5
- Var(S) = 3 × (35 / 12) = 8.75
For 2d20:
- E[S] = 2 × 10.5 = 21
- Var(S) = 2 × 33.25 = 66.5
These formulas describe the ordinary sum of independent dice. They do not automatically apply unchanged to keep-highest, keep-lowest or other order-statistic mechanics.
What Is a Probability Mass Function?
A Probability Mass Function (PMF) gives the probability associated with each possible value of a discrete random variable. For 2d6:
| Total | Probability | Percentage |
|---|---|---|
| 2 | 1 / 36 | 2.78% |
| 3 | 2 / 36 | 5.56% |
| 4 | 3 / 36 | 8.33% |
| 5 | 4 / 36 | 11.11% |
| 6 | 5 / 36 | 13.89% |
| 7 (Peak) | 6 / 36 | 16.67% |
| 8 | 5 / 36 | 13.89% |
| 9 | 4 / 36 | 11.11% |
| 10 | 3 / 36 | 8.33% |
| 11 | 2 / 36 | 5.56% |
| 12 | 1 / 36 | 2.78% |
The probabilities must satisfy the normalization axiom: ∑ P(X = x) = 1. The calculator keeps its internal PMF probabilities at full precision and rounds values only for presentation, so display rounding does not corrupt the mathematical total.
When a dice problem requires broader combinatorial counting, the Permutation & Combination Calculator can be used alongside the dice analysis.
How the Dice Probability Curve Changes as You Add Dice
With one d6, the distribution is flat. With 2d6, the distribution becomes triangular. With 3d6, it becomes more concentrated around the middle. With even more independent dice, the shape becomes increasingly bell-like.
This is related to the Central Limit Theorem, which describes how normalized sums of many independent random variables tend toward a normal distribution under suitable conditions.
It is important not to overstate this: 2d6 is not a continuous normal distribution; 3d6 is not a continuous normal distribution. They remain discrete distributions with finite support. The calculator's educational model makes that distinction explicit.
What Is Advantage?
In systems such as modern D&D, Advantage means rolling two d20s and using the higher result. The current 2024 D&D Basic Rules explicitly describe this procedure.
The equivalent dice notation is:
where kh1 means keep the highest one. For example:
- First d20: 7
- Second d20: 15
Advantage keeps 15 and drops 7. The calculator verifies this exact case.
Advantage Probability
For a d20 without Advantage:
With Advantage, both dice must fail to reach k for the final result to be below k. Therefore:
For a natural 20:
A normal d20 has only a 5% chance of rolling a 20. The calculator independently verifies the 9.75% Advantage value.
What Is Disadvantage?
Disadvantage uses two d20s and keeps the lower result. Current D&D Basic Rules describe exactly that procedure, and also specify that Advantage and Disadvantage cancel when both apply to the same D20 Test.
The corresponding notation is 2d20kl1, where kl1 means keep the lowest one.
For d20 #1 = 7 and d20 #2 = 15, Disadvantage produces 7. The calculator's deterministic test confirms that result.
Advantage vs. Disadvantage Probability
For a natural 20:
Under Disadvantage, both dice must be 20 to produce a natural 20: (1 / 20)² = 1 / 400 = 0.25%. The calculator verifies all three values.
Advantage Does Not Mean “Roll a Higher d20”
This distinction is important. Advantage does not change a d20 into a larger die. You still roll d20 twice. The mechanic changes how the two results are selected:
- Normal: one d20 → keep it
- Advantage: two d20 → keep highest
- Disadvantage: two d20 → keep lowest
That is why Advantage produces a different probability distribution without creating results above 20.
What Is 4d6 Drop Lowest?
A common TTRPG ability-score method is 4d6 keep highest 3, or 4d6kh3. You roll four six-sided dice, discard the lowest one, and add the remaining three.
The current 2024 D&D Basic Rules use exactly this random-generation method for ability scores. For example:
The calculator independently verifies this exact sequence.
The Probability Distribution of 4d6kh3
The ordinary 4d6 sum ranges from 4 to 24. But 4d6kh3 ranges from 3 to 18 because the lowest die is discarded.
The exact mean is approximately 12.2446. The calculator's exact combinatorial PMF verifies:
- support: 3–18
- mean: 12.2446
- PMF sum: 1.0
What Is the Chance of Getting 13 or Higher with 4d6kh3?
There are 6⁴ = 1,296 equally likely ordered four-die outcomes. Exactly 632 produce a final keep-highest-three total of at least 13.
This is the corrected probability used by the calculator after its mathematical audit.
Why 4d6kh3 Is Different from 4d6
Consider 4d6: you add all four dice. Now consider 4d6kh3: you throw away the lowest die before summing. That changes minimum, maximum, mean, variance, PMF shape, and the probability of every total.
Therefore, a probability graph for 4d6 cannot be reused for 4d6kh3. The calculator now computes the correct order-statistic distribution for keep-highest and keep-lowest formulas.
Keep Highest and Keep Lowest
The notation can be generalized:
- Keep Highest (4d6kh3): keep the three highest results.
- Keep Lowest (4d6kl3): keep the three lowest results.
- 2d20kh1: the familiar Advantage-style maximum.
- 2d20kl1: the Disadvantage-style minimum.
These mechanics are order statistics, not ordinary dice sums, so their probability distributions must be calculated differently.
What Are Modifiers?
A modifier changes the final dice result by a constant amount. For 2d6+3, if the dice roll 5 + 4 = 9, then 9 + 3 = 12. So 2d6+3 = 12. The calculator verifies this exact deterministic case.
A negative modifier works similarly: for 2d6-3, if the dice total 9, then 9 - 3 = 6.
How a Modifier Changes a Probability Distribution
A constant modifier does not change the probability shape of the underlying dice. It shifts the support.
For example, 4d6kh3 has support 3...18. Adding 5 gives 4d6kh3+5 with support 8...23. The mean shifts from 12.2446 to 17.2446, while the variance remains 7.0075 because adding a constant changes location, not spread. The calculator verifies this exact relationship.
What Are Exploding Dice?
Exploding dice are a common TTRPG mechanic in which rolling the maximum value triggers another roll of the same die. A typical notation is 1d6!.
Suppose the die produces 6. Because 6 is the maximum, another d6 is rolled. If the next roll is 4, the total is 6 + 4 = 10. The calculator verifies this deterministic sequence.
Multiple Explosions
If the next roll is also the maximum, the process can continue. For example: first roll 6, second roll 6, third roll 2 → 6 + 6 + 2 = 14.
The calculator includes an explicit safety limit so pathological repeated maximum rolls cannot create an infinite execution loop.
Exact vs. Simulated Probability for Exploding Dice
Exploding dice are different from ordinary finite dice distributions because repeated explosions create a theoretically extended tail.
The calculator therefore distinguishes between exact PMF (where it mathematically derives the distribution) and simulated probability (where repeated rolls are sampled to estimate the distribution).
For exploding-dice probability visualization, the current implementation labels the result as:
rather than pretending a finite Monte Carlo simulation is an exact PMF. That distinction is important when interpreting the curve.
What Is a d100?
A percentile die represents values from 1 to 100. The calculator treats d100 as a discrete uniform distribution over those integers.
A percentile convention often uses two d10-style positional dice (tens and ones):
The important property for the calculator is 1 ≤ d100 ≤ 100 with a uniform discrete distribution.
Natural 20 Probability
For one fair d20: P(20) = 1 / 20 = 5%. The term natural 20 generally refers to the die result itself being 20, rather than a total reached after adding modifiers.
Current 2024 D&D rules specify that a 20 on a d20 attack roll is a critical hit, while a 1 is an automatic miss on that attack roll. Those game-specific consequences should not be generalized to every tabletop system.
Consecutive Natural 20s
Independent d20 rolls multiply their probabilities:
- Two consecutive 20s: (1 / 20) × (1 / 20) = 1 / 400 = 0.25%
- Three consecutive 20s: (1 / 20)³ = 1 / 8000 = 0.0125%
The calculator's content audit independently confirms these values.
Why Dice Probability Is Useful for TTRPG Game Design
Probability analysis can answer questions such as:
- How often will players hit a target number?
- How often will a character get a high ability score?
- How much does Advantage change success probability?
- How powerful is a modifier?
- How much does dropping the lowest die shift an ability-score method?
- How extreme are exploding-dice results?
- How concentrated is a dice pool around its mean?
For example, comparing 1d20 with 3d6 shows two completely different risk profiles: a d20 gives a flat probability to every face, while a 3d6 sum strongly favors the middle. That distinction can materially change how a game feels.
Dice as Probability Distributions
The same formula can be understood at three levels:
DICE EXPRESSION
│
▼
RANDOM OUTCOMES
│
▼
PROBABILITY PMF
│
┌──────────┼──────────┐
▼ ▼ ▼
Mean Variance ShapeThe roller gives you one sample. The PMF describes all possible samples. The expected value and variance summarize the distribution. A strong dice tool keeps those concepts separate.
Why One Dice Roll Proves Almost Nothing About Fairness
Suppose a d6 produces 6. That does not mean the die is unfair. A fair die can produce any of its allowed outcomes on any individual roll. Likewise, ten rolls that happen to contain many 6s do not establish bias.
Statistical fairness is about behavior across many independent trials. The calculator's randomness audit therefore uses large samples and a chi-square goodness-of-fit check rather than drawing conclusions from a few visible rolls. Its latest audit tested 100,000 rolls for each supported die configuration.
Cryptographically Secure Randomness
The calculator uses the browser's Web Crypto random source when available. MDN describes crypto.getRandomValues() as providing cryptographically strong random values, and distinguishes it from Math.random(), which is not cryptographically secure.
The important distinction is: cryptographically secure pseudo-random generation is not the same thing as physical hardware randomness. The calculator therefore uses the more accurate interface language: Cryptographically Secure Randomness rather than claiming that every browser roll is literally generated by a hardware random-number generator.
For general random integer generation outside a dice expression, use the Random Number Generator.
Why Rejection Sampling Matters
A simple implementation might obtain a random integer and use random % N to map it to N sides. That can introduce modulo bias when the size of the underlying random space is not evenly divisible by N.
The calculator instead uses rejection sampling for its secure random integer mapping. Its audit explicitly verifies modulo-bias rejection and reports zero out-of-range results across the tested rolls.
Does a CSPRNG Make a Die “Fair”?
It makes the software's random-number generation method substantially more appropriate for unbiased digital randomness than using an ordinary non-cryptographic generator. It does not make a physical die fair. Those are different questions:
Random-number generation → Distribution correctness
Geometry / mass / manufacturing → Physical rolling behavior
Can You Test a Physical Die in Saltwater?
A saltwater float test can provide a rough indication of density or mass asymmetry, but it cannot certify that a physical die is perfectly fair. Floating behavior does not completely evaluate face geometry, corner curvature, edge wear, pip distribution, aerodynamic effects, or surface properties. The calculator explicitly qualifies the test rather than presenting it as proof of fairness.
Dice Probability and the Law of Large Numbers
A theoretical probability describes long-run behavior. For a fair d6: P(6) = 1/6. In 6 rolls, you should not expect exactly one 6; you might get zero, one, two, or more. The proportion tends toward the theoretical probability as the number of trials becomes very large. That is why probability should not be confused with certainty.
Why a PMF Is Different from a Roll History
A PMF is theoretical; a roll log is observed. An empirical session does not redefine the theoretical distribution. The calculator keeps its roll history and theoretical PMF as separate concepts.
TTRPG Formulas and System-Specific Rules
The calculator supports generic dice mathematics, but some mechanics are game-system conventions. For example, Advantage/Disadvantage is strongly associated with D&D, while 4d6 keep-highest-three is a recognized D&D ability-score generation method. Other tabletop games may use different advantage mechanics, reroll rules, critical rules, or success thresholds. A dice expression should always be interpreted in the context of the ruleset using it.
Common Dice Notation Examples
The calculator's parser and deterministic regression tests verify these supported forms and reject malformed expressions instead of silently converting them into an unrelated default roll.
What Happens When a Formula Is Invalid?
A good formula parser should not quietly transform an invalid expression into another formula. Inputs such as 2d, 2.5d6, 0d6, or 2d6++ should not silently become 1d20.
The calculator performs strict validation and returns a controlled error for malformed expressions, ensuring you always know if an expression cannot be parsed.
Probability of Success in a TTRPG
Suppose you need a result of at least 15 on a d20:
- Without Advantage: P(X ≥ 15) = 6 / 20 = 30% (faces 15, 16, 17, 18, 19, 20).
- With Advantage: P(Advantage ≥ 15) = 1 - (14 / 20)² = 1 - 0.49 = 51%.
That is a significant increase without changing the die itself. This is one reason probability calculators are useful for encounter balancing and understanding the practical impact of game mechanics.
Expected Value Is Not the “Most Likely” Result
For 2d6, E[X] = 7, and 7 is also the single most probable total. But that is not always true for every dice mechanic. For example, the mean of 2d20kh1 is 13.825, but individual results remain integers from 1 through 20. The expected value is a statistical center, not necessarily an actual roll or the single most likely outcome.
A Practical Dice Probability Workflow
Choose the dice → Enter the formula → Parse modifiers
↓
Generate random outcome → Apply keep/drop/explosion rules
↓
Calculate final total → Inspect individual dice
↓
Compare with theoretical PMF → Review mean / variance / distributionWhat This Calculator Can & Cannot Determine
- Expected value of 3d6 (10.5)
- Chance of natural 20 (5%)
- Advantage natural-20 probability (9.75%)
- Exact mean of 4d6kh3 (12.2446)
- Probability of 4d6kh3 ≥ 13 (48.8%)
- Exact roll totals with modifiers
- Whether your physical dice are balanced
- Whether a specific game mechanic is "fair"
- Whether one TTRPG's house rules apply
- Whether a random outcome is "due" after a streak
- Predictions of the next individual roll
Final Takeaway
A dice roller can be as simple as 1d20. But once you add 4d6kh3, 2d20kh1, or 1d6!, you are no longer dealing with simple uniform dice—you are dealing with probability transformations.
The first gives you the immediate game result; the second explains the behavior of the mechanic over time.
Frequently Asked Questions
Sources & References
- Wizards of the Coast (2024): D&D Basic Rules – D20 Tests, Advantage/Disadvantage mechanics, and Ability Score Generation (4d6 drop lowest).
- MDN Web Docs: Web Cryptography API –
Crypto.getRandomValues(). Cryptographically strong random integer generation. - NIST Special Publication 800-22: A Statistical Test Suite for Random and Pseudorandom Number Generators for Cryptographic Applications.
- Feller, W. (1968): An Introduction to Probability Theory and Its Applications, Vol. 1. John Wiley & Sons. (Discrete uniform distributions and generating functions).
- Paizo Inc.: Pathfinder Core Rulebook – Tabletop dice notation conventions and dice pool mechanics.
Related Calculators
Random Number Generator
Generate random values for games, experiments and general-purpose tasks.
Probability Calculator
Calculate probabilities for problems beyond dice.
Permutation & Combination Calculator
Solve broader counting and combinatorial problems.