Any dice · expressions · live probability
Dice Roller — Roll Any Dice and See the Real Odds
Pick your dice or type an expression like 2d20kh1+5, roll, and read the real odds before you throw. Every result is drawn with crypto.getRandomValues() and decided before the dice move.
Roll the dice
Press Space or Enter, or click Roll. Total —.
Result
Nothing rolled yet
Theoretical · This session (0 rolls)
How a roll is decided, in the order it happens
When you press Roll, the site first draws every die, then animates the faces to those values. The draw uses crypto.getRandomValues() — the browser API MDN describes as producing “cryptographically strong random values” — and it is the same source for one d6 and for a hundred. Only after the values are fixed does the animation begin, so what you see settling is what was already decided, not a decoration that happens to agree with a number chosen afterwards.
A die has `sides` equally likely faces. Because `sides` almost never divides 2³², a naive “random number modulo sides” would hand the low faces a tiny extra chance. This roller uses rejection sampling instead: it takes a 32-bit word, throws away the top of the range that would break the division, and only then takes the remainder. That is what makes the faces equal, and the test suite draws 100,000 times and holds every face within 1% of 1/sides rather than asking you to take it on faith.
Two rolls are two independent draws. The history list keeps the last hundred results so a disputed round can be checked, and the probability chart below the dice compares the theoretical distribution of your expression with what this session has actually rolled — which is the honest way to show that “it keeps rolling high” is usually a small sample rather than a biased die.
Dice notation, and the expressions this roller understands
The notation is the one every tabletop book uses: `NdM` rolls N dice with M faces, and a constant is added or subtracted with `+` or `-`. So `2d6+3` rolls two six-sided dice and adds three, and `1d20-2` rolls one twenty-sided die and subtracts two. Several groups can be added in one expression, such as `1d8+2d6+4`, which is how a weapon with a modifier and a spell both appear in a single line.
The suffixes cover what a real game needs. `khN` keeps the N highest and `klN` the N lowest — `4d6kh3` is the classic ability-score roll, and `4d6dl1` (drop the lowest one) is the same thing written the other way round. `dhN` and `dlN` drop the N highest or lowest. A `!` makes a die *explode*: rolling the maximum face rolls another die and adds it, up to a hundred extra rolls so a pathological run cannot hang the page. And `adv` and `dis` are shorthand for the two twenty-sided rolls the rules call advantage and disadvantage, so `1d20 adv` means “roll two d20 and keep the higher”.
Anything the parser cannot read returns a plain sentence in the result panel — “Unexpected \"xyz\" in the expression” — instead of a blank page or a silent zero. Groups are limited to a hundred dice and expressions to twenty terms, and the parser says so rather than quietly truncating your roll.
Reading the probability chart
Under the dice there is a histogram with two series. The outlined bars are the exact theoretical chance of each total, computed by convolving the dice — the same arithmetic that says two six-sided dice show a 7 six times in thirty-six, or 16.7%. The filled bars are what this session has actually rolled. With a handful of rolls they will not match, and they are not supposed to; with a few hundred they converge, which is the point of showing both.
For expressions small enough to compute exactly, the theoretical bars are exact and the chart says so. For a very large pool, or for exploding dice whose support is unbounded, the theoretical bars are a deterministic Monte Carlo estimate and the chart is labelled “estimated”, with the sample size printed. The label is not decoration: it is the difference between “this is the answer” and “this is a good estimate of the answer”.
The chart is a picture of your own expression, so it changes when the expression changes. Roll `1d20` and you get a flat line — every face is 5%. Roll `2d6` and you get the familiar peak at 7. Roll `1d20 adv` and the low totals collapse while 20 becomes the most likely single face at 9.75%, which is exactly why advantage feels so strong at the table.
Questions this page answers
Is the roll really random, or is it just an animation?
The values are drawn first, with crypto.getRandomValues(), and the animation is then aimed at them. Every face is equally likely because the sampler uses rejection sampling rather than a modulo, and the unit tests draw 100,000 times and check the frequencies.
What expressions can I type?
NdM rolls N dice of M faces, + and − add or subtract a constant, kh/kl keep the highest or lowest and dh/dl drop them, ! makes a die explode on its maximum face, and adv/dis are shorthand for a d20 with advantage or disadvantage. For example 2d20kh1+5, 4d6dl1, 8d6 or 1d20 adv.
What does the probability chart show?
The outlined bars are the theoretical chance of each total for your expression, computed exactly when the dice pool is small enough and otherwise by Monte Carlo, in which case it is labelled “estimated”. The filled bars are what this session has actually rolled.
Is my expression or history sent anywhere?
No. The expression, the dice and the history stay in this tab. A share link carries your expression in the # fragment of the URL, which browsers do not send to a server, and the telemetry payload contains only the route, a preset name and a count bucket — never the expression text.
Does it work offline, and on a phone?
Once the page has loaded, every roll and every redraw is computed in the tab, so it keeps working without a connection until you reload. At 390 pixels wide the dice sit above the expression box and the Roll button stays in reach.
Sources, and what was actually fetched
Every figure on this site that is not arithmetic comes from one of these pages, read while this build was made. Where a source could not be reached, the page says so instead of pretending.
- MDN — Crypto.getRandomValues() — the API this site draws from, and its wording that the values are “cryptographically strong random values”.
- D&D Beyond — Basic Rules: Using Ability Scores — the advantage and disadvantage rule quoted on the DnD page: “you roll a second d20 … Use the higher of the two rolls if you have advantage, and use the lower roll if you have disadvantage.”
- D&D Beyond — Basic Rules: Step-by-Step Characters — the ability-score method quoted on the DnD page: “Roll four 6-sided dice and record the total of the highest three dice … Do this five more times, so that you have six numbers.”
- W3C — WCAG 2.2 relative luminance and contrast ratio — the luminance formula 0.2126R + 0.7152G + 0.0722B and the ratio (L1 + 0.05) / (L2 + 0.05) used to pick every label colour on the colour dice.
- Wikipedia — Dice notation — the NdM convention and the keep/drop and exploding suffixes this roller implements.
- Wikipedia — Yahtzee — the five-dice game and the note that Yahtzee is a trademark of Hasbro; this site is not affiliated with Hasbro and uses no Hasbro artwork or score sheet.
A dice roller is a random-number generator, not a referee. The faces are equally likely and the probability chart is arithmetic on your expression; the game rules quoted on the DnD and five-dice pages belong to their publishers, and the sources are linked above. Nothing you type is uploaded, and nothing is remembered after you close the tab except the expression this browser saved for you.