Skip to tool

Dice Roller

Each die and the total

Roll a die
Each button rolls straight away.
1 to 100
Advantage and disadvantage
Rolls two d20 and keeps the higher or the lower.
Uses crypto.getRandomValues. Turn off only to compare with Math.random.
Statistics0 rolls

Need at least 30 rolls to compute a chi-square fairness check.

How to write dice notation

Write NdX for N dice with X sides, always with the count: 1d20 is one twenty-sided die, 2d6+3 is two six-sided dice plus 3, and 2d6-1d4+3 mixes dice and constants. Modifiers go after the die. kh3 and kl1 keep the highest 3 or the lowest 1 (4d6kh3, 2d20kl1); dh and dl drop the highest or lowest; ! explodes, rolling again and adding whenever a die shows its maximum; !! compounds the explosions into a single die; r1 rerolls any 1; and >=5 counts the dice showing 5 or more instead of adding them (6d6>=5, as in Shadowrun pools). Each term can have 1–100 dice with 2–1000 sides. The Quick roll tab has buttons for d4, d6, d8, d10, d12, d20 and d100 and rolls up to 100 dice at once.

Checking that the dice are fair

Every kept die result is added to a histogram. After 30 or more rolls of the same die size, the Statistics panel runs a Pearson chi-square goodness-of-fit test against a uniform distribution (N − 1 degrees of freedom) and shows the p-value. A small p-value means the counts would be unlikely with fair dice. Even with fair dice, a p-value below 0.05 appears in about 1 check in 20, so a single low result is not evidence of a problem. You can turn off Secure randomness to compare with Math.random.

How the rolls are generated

Each die is drawn from the browser's cryptographic random number generator (crypto.getRandomValues, part of the W3C Web Crypto API). The 32-bit random value is turned into a face with rejection sampling: values that would make some faces slightly more likely are discarded and drawn again, so each face of a d20 has a probability of exactly 1/20. For standard dice a redraw is rare; for a d100 it happens about 2 times in 100 million draws.

Roll history and scope

The last 100 rolls are kept in this browser's local storage, so the Log tab survives a reload. Clear log removes them, and the log can be exported as JSONL or copied as Markdown. The tool is for games and teaching, not for gambling.

How to roll D&D 5e ability scores

  1. Open the Notation tab: Switch to the Notation tab in the toolbar.
  2. Choose the D&D 5e stat array preset: Press the "D&D 5e stat array" preset. The tool rolls 4d6kh3 six times in a row.
  3. Read the six scores: Each value already drops the lowest of four d6s. The summary shows mean and standard deviation next to the theoretical reference (12.24 / 2.85).

FAQ

Is this dice roller fair?

Yes. Every roll comes from the browser's cryptographic random number generator, and rejection sampling makes every face equally likely (exactly 1/N). You can check it yourself: after 30 rolls of one die size, the Statistics panel shows a chi-square test of the results.

What is dice notation? How do I write 4d6kh3?

4d6kh3 means roll four six-sided dice, keep the highest three and add them, the standard D&D 5e method for ability scores. The roller also supports kl (keep lowest), dh / dl (drop highest / lowest), ! (explode on the maximum), !! (compound explode), r1 (reroll 1s), >=5 (count successes) and modifiers such as +2 or -1d4.

What are the odds of rolling a natural 20?

On one d20 it is 1 in 20, or 5%. With advantage (roll two d20s and keep the higher) it is 1 − (19/20)² = 9.75%; with disadvantage it is (1/20)² = 0.25%. The odds of a natural 1 are the same, with advantage and disadvantage swapped.

How do I roll D&D 5e ability scores?

Open the Notation tab and choose "D&D 5e stat array". The tool rolls 4d6kh3 six times and shows the six scores, their mean and standard deviation, and the expected values for comparison (mean 15869/1296 ≈ 12.24, standard deviation ≈ 2.85).

What is advantage and disadvantage in 5e?

In D&D 5e, advantage means rolling 2d20 and keeping the higher (2d20kh1); disadvantage keeps the lower (2d20kl1). The Advantage and Disadvantage buttons on the Quick roll tab roll these two expressions. The average is 13.825 with advantage and 7.175 with disadvantage, compared with 10.5 for a single d20.

How do exploding dice (Savage Worlds Aces) work?

When a die shows its highest face, you roll it again and add the result, and keep going while it keeps rolling the maximum. In notation, 1d6! is one exploding d6. Its average is exactly 4.2 (3.5 ÷ (1 − 1/6)), compared with 3.5 for a plain d6. Each die explodes at most 50 times.