About the Dice Roller
Most dice rollers on the web use Math.random(), and many of them turn it into a face with modulo — which does not give you a fair die. 256 is not a multiple of 6, so four of the 256 byte values fall in the remainder and faces one to four come up slightly more often than five and six. On a d6 that affects about 1.6% of draws. On a d100 it affects nearly 22%, and low numbers genuinely win.
This one draws from crypto.getRandomValues and uses rejection sampling: any byte above the largest exact multiple is thrown away and redrawn. That removes the bias entirely rather than making it smaller. And because a claim like that is worth nothing unasserted, there is a live chi-square goodness-of-fit test running across every face you roll, so you can check it yourself.
Then the part tabletop players actually want and almost nobody offers: real dice notation — 3d6, 2d20+5, 4d6dl1, adv — with every die shown separately rather than a bare total, dropped dice struck through, and a session log you can export for remote play. The engine was validated in Node against published chi-square critical values and 120,000 simulated rolls: 2,819 assertions.
The rolls you make constantly, one click away. Saved in this browser.
How to Use the Dice Roller
Type what you want to roll in standard notation and press roll. 3d6,
2d20+5, 1d8-2, 4d6dl1 to drop the lowest,
4d6kh3 to keep the highest, or just adv and dis for advantage
and disadvantage. Every individual die is shown, dropped dice are struck through, and everything goes
into a session log you can export.
The Modulo Bias, and Why It Is Worse Than It Sounds
Here is the mistake, and it is genuinely common. You need a number from one to six. You take a random
byte — a value from 0 to 255 — and you reduce it with % 6.
256 divided by 6 is 42 remainder 4. So the values 0 to 251 map evenly onto the six faces, forty-two each. But 252, 253, 254 and 255 have to go somewhere too, and they map onto faces one, two, three and four. Those four faces therefore come up 43 times in 256 instead of 42 — about 2.4 per cent more often than they should. It is not a rounding error and it does not average out; it is a permanent thumb on the scale that persists for as long as the tool runs.
On a d6 that is small enough to shrug at. On a d100 it is not: 256 divided by 100 is 2 remainder 56, so fifty-six of the 256 values — nearly 22 per cent — land in the biased remainder, and the numbers 1 to 56 come up half again as often as 57 to 100. For percentile rolls, which is where people care most, a tool built this way is meaningfully unfair.
Rejection sampling fixes it completely. Draw a byte; if it is 252 or above, throw it away and draw another. What remains divides perfectly, so every face is exactly equally likely. The cost is that you occasionally have to draw twice — about 1.6 per cent of the time for a d6, and 22 per cent for a d100 — which is free on a modern computer. This tool counts those discards and shows you the number, because it is the visible evidence that the technique is actually running.
Checking the Claim Rather Than Believing It
Any dice roller can say it is fair. This one runs a chi-square goodness-of-fit test across every face you have actually rolled, comparing your counts against equal expectation and reporting the probability that fair dice would produce a spread at least this uneven. Roll a few hundred and you can satisfy yourself.
Two honest limits are built into how it reports. It will not give you a p-value until there are at least five expected rolls per face, because the chi-square approximation is not trustworthy below that and a confident-looking number over eleven rolls would be misleading. And a low p-value is not evidence of a broken generator: by definition, one run in twenty of perfectly fair dice produces one. The test was itself validated against published chi-square critical values and against 120,000 simulated rolls, along with a check that repeated fair experiments produce the right distribution of p-values — which is the test that catches a subtly wrong implementation.
Why There Is No Average For 4d6 Drop Lowest
Roll three six-sided dice and the average is 10.5, which is simply three times the average of one die. Roll four and drop the lowest and the average is about 12.24 — nearly two points higher — and, more importantly, the whole shape of the distribution changes. High results become considerably more likely rather than the middle merely shifting.
That is why this tool prints a mean for plain rolls and deliberately refuses to for keep-and-drop ones. The flat formula does not apply, quoting it anyway would be wrong, and the subscriber panel computes the genuine distribution instead of guessing at it.
Same fair generator, applied to two sides instead of six: the Coin Flip also tells you whether your streak is genuinely unusual. And if you want to find out how badly humans fake randomness, Can You Fake Randomness? uses the same statistics to catch you. Browse every Fun & Novelty tool for more.
Frequently Asked Questions
What is wrong with Math.random for dice?
Two separate things, and only one of them is usually the problem. Math.random is not cryptographically secure and is not seeded unpredictably, which matters if anyone has a reason to cheat. The bigger practical issue is how the number gets turned into a face. Take a random byte and reduce it with modulo six and you do not get a fair die: 256 is not a multiple of 6, so four of the 256 values fall in the remainder and faces one to four come up slightly more often than five and six. This tool draws bytes from the cryptographic generator and discards any that fall outside the largest exact multiple, which removes the bias completely rather than shrinking it.
How much does that bias actually matter?
For a six-sided die it is small — about 1.6 per cent of raw draws land in the biased remainder. For a hundred-sided die it is not small at all: 256 divided by 100 leaves a remainder of 56, so nearly 22 per cent of draws are affected, and low numbers come up meaningfully more often than high ones. Any tool that maps a byte straight onto a d100 with modulo is measurably unfair, and percentile rolls are exactly where people care.
What notation does it understand?
The forms players actually type. 3d6 and d20 for plain rolls, 2d20+5 and 1d8-2 for modifiers, 4d6dl1 to drop the lowest and 4d6kh3 to keep the highest, plus dh and kl for the opposites. The words adv and dis expand to 2d20kh1 and 2d20kl1. Anything it does not fully understand is refused rather than guessed at, because a dice roller that quietly reinterprets your input is worse than one that says no.
What is the uniformity check telling me?
It is a chi-square goodness-of-fit test across every face you have rolled of a given die size, comparing the counts you got against equal expectation. The p-value is the probability that fair dice would produce a spread at least this uneven. It will not report anything until there are at least five expected rolls per face, because below that the approximation is not trustworthy and printing a number would be misleading. Note also that a low p-value here is not evidence of a bug: one run in twenty of perfectly fair dice produces one.
Does 4d6 drop lowest really change the average that much?
Yes, and more than most people assume. Straight 3d6 averages 10.5. Rolling four dice and dropping the lowest averages about 12.24 — nearly two points higher — and it also changes the shape of the distribution, making high results considerably more likely rather than just shifting the middle. That is why this tool refuses to print a simple mean for keep-and-drop rolls: the flat formula does not apply, and quoting it would be wrong.