PureTools

Dice Roller: Generate Random Numbers for Tabletop Games

PureTools Team· 6 min read
Dice Roller: Generate Random Numbers for Tabletop Games

Virtual Dice for Every Game

Whether you're deep in a Dungeons & Dragons campaign, playing a board game, or just need a quick random number, a virtual dice roller is essential. No more lost dice, no more disputes about fair rolls.

Understanding Dice Notation

Tabletop RPGs use a standard notation called NdX, where N is the number of dice and X is the number of sides:

NotationMeaningRange
1d6One six-sided die1-6
2d6Two six-sided dice2-12
1d20One twenty-sided die1-20
3d8+5Three eight-sided dice plus 58-29
1d100Percentile die1-100

Common Dice Types

  • d4: Tetrahedron. Used for small damage (daggers) in D&D
  • d6: The classic cube. Board games, Yahtzee, gambling
  • d8: Octahedron. Medium weapons in RPGs
  • d10: Pentagonal trapezohedron. Often paired for percentile rolls
  • d12: Dodecahedron. Heavy weapons, barbarian hit dice
  • d20: Icosahedron. The most iconic RPG die - attack rolls, saving throws, skill checks

Probability Basics

With a single d6, each face has a 1/6 (16.67%) chance. But with 2d6, the distribution is no longer uniform. 7 is the most likely result (6 combinations out of 36 = 16.67%), while 2 or 12 each have only 1/36 (2.78%) chance.

Are Digital Dice Fair?

Digital dice use pseudo-random number generators (PRNGs). Modern PRNGs like crypto.getRandomValues() are cryptographically secure and produce better randomness than physical dice, which can be slightly biased due to manufacturing imperfections.

// Cryptographically random dice roll
function rollDie(sides) {
  const array = new Uint32Array(1);
  crypto.getRandomValues(array);
  return (array[0] % sides) + 1;
}

Ready to roll? Use the PureTools Dice Roller to roll any combination of dice instantly. Supports d4, d6, d8, d10, d12, d20, d100, and custom dice with modifiers.