Dice Roller

Roll any dice online, from a single d20 to 3d6+2 or 4d6 drop lowest, with fair crypto-random rolls, a roll history and the exact odds of every total.

The interactive tool loads here when JavaScript runs.

About this tool

What is the Dice Roller?

Type the dice you need, or tap a quick pick from d4 to d100, and press Roll. The Dice Roller reads the standard notation used in board game and role-playing rulebooks: 3d6 is three six-sided dice added together, d20+5 adds five to one twenty-sided die, and 4d6kh3 rolls four dice and keeps the highest three. You see every die, the dropped ones struck through, the total, and a history of your last 25 rolls that you can copy.

Next to the result is the full odds table for whatever you typed, counted exactly over every combination of faces rather than estimated by simulation. For 2d6 it shows that 7 comes up 6 times in 36 (16.7%), and after each roll it tells you how likely that total was and how often you would roll that much or more. That is handy when someone at the table insists the dice are cursed.

  • Standard dice notation: NdS, d%, keep and drop (kh, kl, dl, dh), several dice and modifiers in one roll
  • Fair rolls from crypto.getRandomValues with rejection sampling
  • Exact odds for every total: exactly, at least and at most, with a chart
  • Average, standard deviation, most likely total and range
  • Roll history of the last 25 rolls, copyable, with dropped dice marked
  • Shareable link that opens the same dice; runs entirely in your browser
Read the guide: Game Night Kit: Dice, Brackets, Scores and Would You Rather

Updated

How to use the Dice Roller

  1. Type dice notation in the box, such as 2d6, d20+3 or 4d6kh3, or tap one of the quick picks.
  2. Press Roll or hit Enter. The total appears in large type, with every die shown; dice dropped by a keep or drop rule are struck through.
  3. Read the odds table on the right: the chance of exactly each total, at least that total and at most that total. The total you just rolled is highlighted.
  4. Keep rolling; the history lists your last 25 rolls with the dice behind each one. Copy the history or share a link that opens the same dice.

Worked examples

Two six-sided dice

Input

2d6

Output

Average 7; a 7 comes up 16.7% of the time (1 in 6); 2 or 12 only 2.78% each

There are 36 equally likely ways two dice can land, and 6 of them add up to 7. The extremes need both dice to show the same face, so each has a single way.

Rolling with advantage

Input

2d20kh1

Output

Average 13.825, up from 10.5 for a single d20; 20 comes up 9.75% of the time

Keeping the higher of two d20s turns a flat 5% per face into a ramp: a 20 now has 39 ways in 400, and a 1 has only one way, both dice showing 1.

Ability scores: 4d6 drop the lowest

Input

4d6dl1

Output

Average 12.245, most likely 13; an 18 comes up 21 times in 1,296 (1.62%)

Dropping the lowest of four dice lifts the average from 10.5 for plain 3d6 to 12.245. The tool rewrites 4d6dl1 as the equivalent 4d6kh3.

Mixed dice with a modifier

Input

1d8+1d6-1

Output

Range 1 to 13, with 6, 7 and 8 equally most likely at 12.5% each

A d8 plus a d6 has 48 combinations. The middle of the range forms a flat top three totals wide because the dice have different sizes.

Background and insight

The "NdS" notation is the common shorthand in tabletop rulebooks, virtual tabletops and dice bots. Keep and drop modifiers extend it: kh (keep highest), kl (keep lowest), dl (drop lowest) and dh (drop highest). Rolling two d20s and keeping the higher one is how several games model an advantage, and 4d6 drop the lowest is a common way to roll character ability scores. This tool accepts those forms, d% for a percentile die, and sums of several dice and whole numbers such as 1d8+1d6-1.

The odds come from convolution: the chance of each total for one die is spread over the next die's faces, one die at a time, which is the same as expanding (x + x^2 + ... + x^s)^n and reading off the coefficients, the method MathWorld's dice article gives. Keep-highest and keep-lowest rolls need more care, because which dice count depends on all of them, so the tool counts them by placing faces from best to worst and tracking how many dice are still kept. Counts are exact whole numbers (BigInt), so even 100d100 gives exact chances.

Fair rolls need two things: a good random source and an unbiased way to turn random bits into a face. Each die here draws from crypto.getRandomValues, the browser's cryptographic random number generator defined in the W3C Web Cryptography API, and uses rejection sampling: a 32-bit draw that falls in the small leftover zone above the largest multiple of the side count is thrown away and redrawn, so a d6 gets exactly one sixth per face instead of the slight tilt that a plain remainder (draw % 6) would give.

Common use cases

  • Board games with missing dice

    Roll the 2d6 a board game needs on a phone when the dice are lost, or when a player cannot handle small dice.

  • Role-playing sessions

    Roll attack and damage dice such as 1d20+5 and 2d6+3, advantage and disadvantage, and 4d6 drop lowest for new characters.

  • Checking whether a house rule is fair

    Compare the odds table for two dice expressions before you change a rule, for example 3d6 against 1d20 for a skill check.

  • Classroom probability

    Show students why 7 is the most common total with two dice, then compare a simulated tally of real rolls with the exact chances.

Tips and limitations

  • Spaces are allowed around + and -, but "3d6 2" is rejected rather than read as 3d62. Write 3d6+2.
  • Up to 100 dice per expression and 2 to 1,000 sides per die. Very large keep rolls (for example 100d1000kh50) still roll, but the odds table is skipped because there are too many combinations to count in the page.
  • When dice tie for the last kept place, the earlier die in the row is kept. The total is the same either way.
  • Up to 1,000 totals are listed one per row. For wider ranges such as 100d100 the table leaves out only edge totals rarer than 0.005% each, says which totals it covers and what share of rolls land there, and groups the rest into ranges of equal width if there are still too many rows. The average, the standard deviation and the line under your roll always use every total.
  • A streak of low rolls is not evidence of a problem. Five 1s in a row on a d20 has a 1 in 3,200,000 chance, but over thousands of rolls at a busy table, runs of three or four happen.

Sources and further reading

  1. Web Cryptography API: getRandomValues, W3C. The cryptographic random source each roll uses
  2. Dice, Wolfram MathWorld. The polynomial method for the number of ways to roll each total
  3. Fast Random Integer Generation in an Interval, ACM Transactions on Modeling and Computer Simulation. Lemire, 2019: why a plain remainder is biased and how rejection fixes it

Frequently asked questions

What does 3d6+2 mean?

Roll three six-sided dice, add them up and add 2. The number before the d is how many dice, the number after it is how many sides each die has, and anything after a plus or minus sign is added or taken away. 3d6+2 gives totals from 5 to 20, with an average of 12.5.

How do I roll with advantage or disadvantage?

Type 2d20kh1 to roll two d20s and keep the higher one (advantage), or 2d20kl1 to keep the lower one (disadvantage). Advantage raises the average from 10.5 to 13.825 and the chance of a natural 20 from 5% to 9.75%.

Are online dice as random as real dice?

They are at least as fair. Each die here draws from your browser's cryptographic random number generator and discards draws that would make some faces slightly more likely, so every face has exactly the same chance. Physical dice can be slightly unbalanced by manufacturing, worn edges or the way they are thrown.

What is d% or a percentile die?

d% is shorthand for d100, a roll from 1 to 100, traditionally made with two ten-sided dice, one for the tens and one for the units. Type d% or d100; both give the same thing here.

How are the odds in the table calculated?

Exactly, by counting every combination of faces. Two six-sided dice have 36 combinations, three have 216, and 4d6 has 1,296. The tool builds those counts die by die (convolution) instead of simulating rolls, so the percentages are exact up to rounding.

What is the difference between kh and dl?

They are two ways to write the same roll. kh3 keeps the highest three dice; dl1 on four dice drops the lowest one, which also leaves the highest three. 4d6kh3 and 4d6dl1 have identical odds, and the tool shows both as 4d6kh3.

Is there an in-depth guide to the Dice Roller?

Yes. “Game Night Kit: Dice, Brackets, Scores and Would You Rather” covers the background, how it works, common pitfalls and worked examples. Read the full guide.