Skip to main content

Draws are taken from your browser's cryptographic random source, not Math.random, so every outcome is equally likely.

2

Two dice are not one die twice

A single die is flat: every face is equally likely. Add a second and the sums stop being flat, because there are six ways to make 7 and only one to make 2. That is why 7 comes up six times as often as snake eyes, and why board games are built around it.

How it works

  • Rolls between one and twelve dice of any standard size, from a d4 to a d100.
  • Draws each face from crypto.getRandomValues() with rejection sampling, so no face is favoured.
  • Keeps a running total and average across every roll of the session.
one die with s faces: each face has probability 1/s

n dice summed: the number of ways to reach a total t is the
coefficient of x^t in (x + x^2 + ... + x^s)^n

expected total = n × (s + 1) / 2

Worked example

Rolling two ordinary six-sided dice.

  1. 36 equally likely outcomes in total
  2. total 2 → only 1+1, so 1 way, probability 1/36 ≈ 2.8%
  3. total 7 → 1+6, 2+5, 3+4, 4+3, 5+2, 6+1, so 6 ways, probability 6/36 ≈ 16.7%
  4. total 12 → only 6+6, so 1 way ≈ 2.8%
  5. expected total = 2 × 3.5 = 7

Seven is six times as likely as two. Over many rolls the running average settles near 7.0, but any single roll is still anything from 2 to 12.

Reading the result

  • The average shown is over completed rolls in this session, so it wanders early and settles as the count grows. Twenty rolls landing on 7.6 is not a loaded die; it is twenty rolls.
  • Math.random() is fine for animation but is not guaranteed uniform and is seeded per tab. These draws come from the browser's cryptographic source instead, with values in the final partial block rejected so the modulo does not skew the low faces.
  • A d100 is drawn as a single number from 1 to 100, not as two d10s, so every value is equally likely.

Common questions

Are these dice really random?
They are drawn from the same cryptographic source browsers use for security-sensitive work. That is stronger than a physical die, which has rounded corners, uneven pips and a bias you can actually measure.
Why did I get the same number four times in a row?
Because runs are ordinary. Four sixes in a row on one die has probability 1/1296 — which sounds rare, but you will see it roughly once in every 1296 sets of four, and people roll a lot.