Dice Roller
Roll dice of any side count — d4, d6, d8, d10, d12, d20, d100.
About the Dice Roller
The Dice Roller simulates rolls of standard polyhedral dice: d4, d6, d8, d10, d12, d20, and d100. Enter the number of dice, the number of sides, a flat modifier, and how many times to roll — the tool returns each die’s result, the sum, and the statistics across all rolls.
The seven polyhedral shapes correspond to the five Platonic solids (d4, d6, d8, d12, d20) plus the d10 (a pentagonal trapezohedron, not a Platonic solid) and the d100 (typically a pair of d10s, one for tens and one for units). These shapes are the standard set used in tabletop role-playing games since the publication of Dungeons & Dragons in 1974. Gary Gygax and Dave Arneson adopted polyhedral dice from existing educational math manipulatives, and the convention has stuck.
The math behind a fair die is simple: each face has equal probability of landing face-up. For an n-sided die, that probability is 1/n. The sum of k dice with n sides ranges from k (all ones) to k*n (all n), with the average being k*(n+1)/2. The distribution is a discrete approximation to a normal (Gaussian) curve, by the central limit theorem.
The modifier is a flat value added to (or subtracted from) the sum of the dice. In D&D 5th edition, a typical skill check is d20 + ability modifier + proficiency bonus. This tool only supports a single flat modifier; for full character sheets with multiple modifiers, use a dedicated VTT (virtual tabletop) like Roll20 or Foundry.
How It Works
Each die roll is computed as 1 + Math.floor(Math.random() * sides). This generates a uniform integer in [1, sides]. The formula uses Math.floor rather than Math.round because Math.round would put the endpoints (1 and sides) at half the probability of the interior values.
For count dice of sides sides, the sum ranges from count (all ones) to count * sides (all max values). The expected value is count * (sides + 1) / 2 — the per-die average multiplied by the number of dice.
The modifier is added to (or subtracted from) the sum: total = sum(dice) + modifier. A negative modifier is supported for situations like a curse or disadvantage.
For multiple rolls, the tool generates rolls independent rolls and reports the sum, average, min, and max across all rolls. The central limit theorem implies that as the number of rolls grows, the average across rolls converges to the expected average (count * (sides + 1) / 2 + modifier).
Edge cases: a die count of 0 is rejected. A side count of 1 is rejected (a 1-sided die is deterministic). The tool caps the die count at 100 and the side count at 1000 to prevent memory issues from extreme inputs. The number of rolls is capped at 1000 for the same reason; only the first 20 rolls are shown in the output to keep the display readable.
Worked Examples
Default: 2d6 with no modifier, 1 roll. Possible results range from 2 (snake eyes) to 12 (boxcars). The expected value is 2 * 7 / 2 = 7. This is the classic Monopoly roll.
1d20 + 5 (a typical D&D 5e skill check for a level-1 character with +3 ability and +2 proficiency). Possible results: 6 to 25. Expected: 10.5 + 5 = 15.5. The d20 is famous for its flat distribution — every value from 1 to 20 has equal 5% probability.
4d6 drop lowest (D&D ability score generation, not directly supported): the typical method generates an ability score by rolling 4d6, summing the highest 3. This tool does not support drop-lowest; use the count=3 setting for a simpler approach.
3d6 with 10 rolls: the average of the 10 rolls should be close to 3 * 7 / 2 = 10.5. Due to the central limit theorem, the average converges to 10.5 as the number of rolls grows. The minimum possible is 3 (all ones); maximum is 18 (all sixes).
1d100 (percentile, used for random encounter tables and loot tables in D&D). Possible results: 1 to 100, each at 1% probability. Many tables in the Dungeon Master’s Guide use d100 rolls.
When to Use This Tool
- Rolling dice for tabletop RPGs when physical dice are not available or when playing online without a VTT.
- Generating random numbers in the 1-100 range for percentile tables (loot drops, random encounters).
- Simulating D&D skill checks with a d20 plus modifier.
- Running a quick game of Yahtzee, Farkle, or Liar’s Dice when physical dice are missing.
- Teaching probability — the distribution of sums of multiple dice approximates a normal curve, illustrating the central limit theorem.
- Generating random sample sizes for Monte Carlo simulations or quick bootstrap tests.
- Deciding ties in board games by rolling a higher die.
Limitations & Disclaimer
The roller uses JavaScript’s Math.random(), a pseudo-random number generator suitable for tabletop gaming and teaching but not for cryptographic uses or real-money gambling. Drop-lowest, drop-highest, explode (reroll on max), and re-roll-once mechanics are not supported — use a dedicated RPG dice bot for those. The dice count is capped at 100 and the side count at 1000 to prevent memory issues. Only the first 20 rolls are displayed in the output, though the statistics include all rolls. See our disclaimer for full terms.
Frequently Asked Questions
Is the dice roller truly random?
It uses JavaScript’s <code>Math.random()</code>, a PRNG based on xorshift128+ (in V8). Statistical tests (like the Diehard suite) confirm uniform distribution. For cryptographic uses or gambling with real money, use <code>crypto.getRandomValues()</code>; for tabletop gaming and teaching, the PRNG is more than sufficient. Casinos use certified hardware RNGs audited by gaming commissions.
Why does the same result come up twice in a row sometimes?
Each roll is independent. The probability of any specific result on a d20 is 1/20 (5%), so a 20 followed by another 20 has probability 1/400 (0.25%). Over thousands of rolls, repeats are expected. The gambler’s fallacy is the mistaken belief that past rolls affect future ones — they do not.
What is the difference between d20 and d100?
A d20 has 20 faces (an icosahedron, one of the Platonic solids); each face has a 5% probability. A d100 is typically simulated by rolling two d10s: one for the tens digit (00, 10, 20, ..., 90) and one for the units digit (0-9). The result ranges from 1 to 100, each at 1% probability. A true 100-sided polyhedron exists (the Zocchihedron) but is rare and less fair than the two-d10 method.
How do I roll 4d6 drop lowest?
This tool does not support drop-lowest directly. Workaround: roll 4d6 once, manually subtract the lowest die value. Alternatively, set <code>rolls=4</code> and <code>count=1</code>, then average or take the highest. For automated drop-lowest, use a dedicated RPG dice bot or VTT.
What is advantage and disadvantage in D&D 5e?
With advantage, roll 2d20 and take the higher; with disadvantage, take the lower. Advantage roughly corresponds to a +5 effective bonus, disadvantage to a -5 penalty, but the distribution is non-linear. This tool does not directly support advantage/disadvantage; roll twice with count=1 and apply the rule manually.
What is the average roll for a d20?
10.5. The expected value of a fair n-sided die is <code>(n + 1) / 2</code>. For a d20, that is 10.5. The expected sum of k dice is <code>k * (n + 1) / 2</code>. So 3d6 averages <code>3 * 7 / 2 = 10.5</code>, the same as 1d20, but the 3d6 distribution is bell-shaped while the d20 is flat.
Last updated: September 9, 2026 · Author: HT99 Tools Editorial Team