Dice Roller

Roll dice: e.g. 2d6 = two 6-sided dice, 1d20 = one 20-sided die.

Back to all tools on ToolForge

More in Generators

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:

Dice Probability Reference

DiceMinMaxMeanCommon Use
1d4142.5Small damage, random options
1d6163.5Standard dice, board games
1d8184.5Medium weapon damage
1d101105.5Percentile (with another d10)
1d121126.5Large weapon damage
1d2012010.5D&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

SystemPrimary DiceMechanic
D&D 5ed20, d4-d12Roll d20 + modifiers vs DC
Pathfinderd20, d4-d12Similar to D&D 5e
World of Darknessd10Roll pool, count successes (8+)
FATEd6 (Fudge)4dF with -/blank/+ faces
GURPSd6Roll 3d6, low is good
Savage Worldsd4-d12Roll 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.