Dice roller
Choose how many dice and how many sides, then roll.
Press Roll.
How it works
Each die is rolled separately with the browser’s cryptographic randomness, so every face is exactly as likely. A physical die is rarely that fair: rounded corners and drilled pips make the faces weigh slightly differently.
With two six-sided dice, seven is the most common total. There are six ways to make seven but only one way to make two or twelve, so the total is never evenly spread even though each die is.
Dice with other numbers of sides are used in role-playing games: d4, d8, d10, d12 and d20, where d stands for die and the number for its sides. The d100 is used for percentile rolls.
Enter a number of rolls and they are all made at once and shown in a table. Copy the table and paste it into Excel or Google Sheets; the columns come with it. Below the table, how often each total came up is compared with how often it should. The more rolls, the closer they get.
How each die is rolled
Each die is a separate call to the browser’s cryptographic random source, which returns a whole number between 0 and 4,294,967,295. Six does not divide the 4,294,967,296 possible values exactly; four are left over. Those four highest values are therefore thrown away and a new number is drawn, so that each face gets exactly 715,827,882 values. A redraw is needed about once in a billion rolls.
The remainder after dividing by the number of sides, plus one, is the face shown. A d10 therefore gives 1 to 10, and a d100 gives a number from 1 to 100 in a single draw. For the d100, 96 values are discarded, and for the d10 six.
How the expected spread is worked out
The Expected column is calculated exactly, not simulated. The tool starts with one die and adds one at a time, spreading each total evenly over the totals the next die can lead to. Three six-sided dice have 216 outcomes. Totals of 10 and 11 can each be made in 27 ways, 12.5% apiece, while 3 and 18 can be made in only one way and turn up in 0.46% of rolls.
The average should come out at the number of dice times the number of sides plus one, divided by two: 7 for 2d6 and 31.5 for 3d20.
Example: 10,000 rolls of two dice
Seven should come up in one roll in six, 1,666.7 times. The count follows a binomial distribution with a standard deviation of the square root of 10,000 × 1/6 × 5/6, about 37.3. Anything between roughly 1,592 and 1,741 sevens is perfectly normal. A test run of the tool’s own code gave 1,711 sevens, 297 twos where 277.8 were expected, and an average of 6.97.