Dice Roller
Roll dice: e.g. 2d6 = two 6-sided dice, 1d20 = one 20-sided die.
Back to all tools on ToolForge
Number of dice
Sides per die
Result
Rolls:
Sum:
About Dice Roller
This dice roller simulates common dice rolls such as `2d6` or `1d20`.
It is useful for tabletop games, classroom activities, probability demos and any quick situation where you need virtual dice.
Understanding NdS Dice Notation
Dice notation uses the format NdS where N is the number of dice and S is the number of sides:
- 1d6: One 6-sided die (results: 1-6)
- 2d6: Two 6-sided dice (results: 2-12, bell curve)
- 1d20: One 20-sided die (results: 1-20, uniform)
- 3d8: Three 8-sided dice (results: 3-24)
- 4d6 drop lowest: Roll four d6, drop the lowest (common for D&D stats)
Dice Probability Reference
| Dice | Min | Max | Mean | Common Use |
|---|---|---|---|---|
| 1d4 | 1 | 4 | 2.5 | Small damage, random options |
| 1d6 | 1 | 6 | 3.5 | Standard dice, board games |
| 1d8 | 1 | 8 | 4.5 | Medium weapon damage |
| 1d10 | 1 | 10 | 5.5 | Percentile (with another d10) |
| 1d12 | 1 | 12 | 6.5 | Large weapon damage |
| 1d20 | 1 | 20 | 10.5 | D&D attack rolls, skill checks |
Expected Value Calculation
// Expected value for 1dS = (S + 1) / 2
// Expected value for NdS = N × (S + 1) / 2
// Examples:
// 1d6: (6 + 1) / 2 = 3.5
// 2d6: 2 × (6 + 1) / 2 = 7
// 1d20: (20 + 1) / 2 = 10.5
// 3d6: 3 × (6 + 1) / 2 = 10.5
// 4d6: 4 × (6 + 1) / 2 = 14
// JavaScript implementation:
function rollDice(n, sides) {
let rolls = [];
for (let i = 0; i < n; i++) {
rolls.push(Math.floor(Math.random() * sides) + 1);
}
return { rolls, sum: rolls.reduce((a, b) => a + b, 0) };
}
Common Dice Systems
| System | Primary Dice | Mechanic |
|---|---|---|
| D&D 5e | d20, d4-d12 | Roll d20 + modifiers vs DC |
| Pathfinder | d20, d4-d12 | Similar to D&D 5e |
| World of Darkness | d10 | Roll pool, count successes (8+) |
| FATE | d6 (Fudge) | 4dF with -/blank/+ faces |
| GURPS | d6 | Roll 3d6, low is good |
| Savage Worlds | d4-d12 | Roll trait die + wild die (d6) |
Frequently Asked Questions
- What is the probability distribution of dice rolls?
- Single dice have uniform distribution (each face has equal 1/n probability). Multiple dice create bell-shaped distributions: 2d6 produces sums 2-12 with 7 being most likely (6/36 = 16.67%). The central limit theorem applies: more dice create more normal distributions centered around the mean (n × (sides+1)/2).
- What does NdS notation mean in dice rolling?
- NdS notation means 'N dice with S sides'. Example: 2d6 = roll two 6-sided dice, 1d20 = roll one 20-sided die, 3d8 = roll three 8-sided dice. Results are summed unless specified otherwise. Modifiers like 2d6+3 add bonus to the total.
- How does computer random number generation work for dice?
- Computers use pseudo-random number generators (PRNGs) like Math.random() which produce values 0 to 1. For dice: result = floor(random() × sides) + 1. This gives uniform distribution across 1 to sides. For cryptographic fairness, use crypto.getRandomValues() instead.
- What are common polyhedral dice used in gaming?
- Standard RPG dice sets include: d4 (tetrahedron), d6 (cube), d8 (octahedron), d10 (pentagonal trapezohedron), d12 (dodecahedron), d20 (icosahedron). d20 is central to D&D 5e for attack rolls and skill checks. d100 (percentile) uses two d10s for 1-100 range.
- How do you calculate expected value for dice rolls?
- Expected value for 1dS is (S+1)/2. For NdS: E = N × (S+1)/2. Examples: 1d6 = 3.5, 2d6 = 7, 1d20 = 10.5, 3d6 = 10.5. This represents the long-term average. Individual rolls vary, but over many rolls the average approaches expected value.
- What is advantage/disadvantage in dice rolling?
- Advantage means roll twice and take the higher result; disadvantage means roll twice and take the lower. In D&D 5e, advantage on 1d20 increases average from 10.5 to ~13.8 (+3.3 bonus equivalent). This mechanic replaces flat modifiers for more dramatic swing potential.