FLXCode Dice Roller

FLXCode apps

Appearance

Dice Roller

Press a die or type notation like 2d6+3 and roll. Keep or drop dice, explode them, roll d20 with advantage, and see the exact chance of every total. Your saved rolls stay in this browser.

Press a die or Roll.

Space or Enter rolls again. Keys 1 to 7 roll d4 to d100.
How many dice
Modifier
d20 roll

Examples: 2d6+3, 4d6kh3 (keep the 3 highest), 2d20kl1 (disadvantage), 3d6! (exploding), 4d6r1 (reroll 1s), 1d8+2d6+4, d%. Up to 100 dice with up to 1000 sides.

Odds for this roll

Mean
–
Most likely
–
Range
–
Spread (SD)
–
–

Saved rolls

    Nothing saved yet. Type 8d6, call it Fireball and press Save.

    History (0)

      No rolls yet in this tab.

      No ads. No account. Nothing you type or record is uploaded. We count page events with a daily code. Check it. What this tool keeps and sends.

      Problem or idea? Email us

      How to use it

      1. Set how many dice and a modifier, then press a die. d20 with the count at 1 and Advantage on rolls two d20 and keeps the higher.
      2. Or type notation in the box and press Roll or Enter. A mistake is shown with the character it stopped at.
      3. Each die is shown. Dropped dice are dashed and crossed out. The total is the big number.
      4. To keep a roll, give it a name and press Save, for example "Fireball" for 8d6. Press the saved roll to roll it.
      5. The odds panel under the roll shows the chance of every total, the mean, and the chance of reaching a number you pick.

      Delete and Clear history do not ask first. They show an Undo button for 8 seconds.

      Dice notation

      What you can type. Case does not matter.
      WriteMeaning
      2d62 six-sided dice, added up. d20 is one die.
      2d6+3, 1d8+2d6+4Add or subtract dice and numbers. Up to 20 terms and 500 dice.
      d%, 3d%Percentile, same as d100.
      4d6kh3, 2d20kl1Keep the highest or lowest. kh alone keeps 1.
      4d6dl1, 5d6dh2Drop the lowest or highest dice.
      4d6r1Reroll a die that shows 1 (or 2 for r2 and so on) once, and keep the new roll.
      3d6!, 3d6!5Exploding: a die that shows its top face, or the number after the !, or higher, is rolled again and added. At most 20 extra rolls per die.

      Limits: 100 dice in a term, 1000 sides, 200 characters. Modifiers can be combined in one term, 4d6r1kh3 rerolls 1s and then keeps the 3 highest.

      How the numbers are drawn

      The page asks the browser for 32 random bits with crypto.getRandomValues. To get a number below n (6 for a d6), it takes the word modulo n, but first throws away words at the top of the range that do not fill a whole round: for n = 6 that is the last 4 of 4,294,967,296 words. Without that step faces 1 to 4 would come up a very little more often. Our test draws 600,000 d6 rolls from a fixed source and checks a chi-square value against the 5% line.

      How the odds are worked out

      Each term has a list of chances, one for every total it can give. For a plain term the page combines the dice one after another (a convolution), and terms are combined the same way. Keep and drop use a count of how many dice show each face, from the top face down. Two six-sided dice give a 7 with chance 6/36 = 16.7%. 3d6 has a mean of 10.50. 4d6kh3, the usual way to roll an ability score, has a mean of 12.2446, higher than 3d6.

      For a d20, reaching 15 or more is 30% with one die, 51% with advantage and 9% with disadvantage. Very big rolls (a term with more than 12,000 possible totals) are rolled but their odds are not worked out. The numbers are checked against a full count of every outcome in Python.

      Ideas

      • Tabletop role-playing: save "Attack 1d20+5", "Fireball 8d6" and "Ability score 4d6kh3".
      • Board games with a missing die: roll 2d6 or 1d6 for a turn.
      • Teaching probability: type 2d6 and look at the shape, then try 3d6 and 1d20. The bars are exact.

      Limits

      • No dice are simulated physically. The result is drawn first and then shown.
      • Sound is off at first. When on, each die makes a short click. If your device asks for less motion, the dice do not tumble.
      • Saved rolls stay in this browser. Clearing site data or a private window removes them. The history lasts as long as the tab.
      • Rerolls and explosions follow the rules written above, which differ a little between games. Check yours.

      Rolls, notation and names stay on your device. We count events without cookies, like "a roll started from a key", and never send a roll or what you typed (details).

      FAQ

      Is the roll really random?

      Yes. Every number comes from crypto.getRandomValues, the random source browsers use for keys and passwords. To turn a 32-bit random word into a number from 1 to 6, the page throws away the few words that would make some faces a tiny bit more likely (rejection sampling), so there is no modulo bias. The tumbling numbers you see while the dice roll are for show.

      What does 4d6kh3 mean?

      Roll 4 six-sided dice and keep the 3 highest. kl keeps the lowest, dl drops the lowest and dh drops the highest, so 4d6dl1 is the same as 4d6kh3. Dropped dice stay on screen, greyed and crossed out, so you can see what was thrown away.

      How do I roll with advantage?

      Press Advantage, then d20. It rolls two d20 and keeps the higher one, written 2d20kh1. Disadvantage keeps the lower one, 2d20kl1. If the notation box already has a d20 in it, pressing Advantage or Disadvantage rewrites that d20 for you and leaves the rest as typed.

      What is the chance of hitting a number?

      The odds panel works out every possible total of the roll in the box, then adds up the chances at or above your number. For example a d20 reaches 15 or more with a chance of 30%, with advantage 51%, with disadvantage 9%. The numbers are exact, not simulated.

      How long do my presets and my roll history last?

      Saved rolls (a name and the notation, up to 30) are kept in this browser, on this device only. The history of the last 50 rolls lives in this tab and is gone when you close it. Delete and Clear history show an Undo button for 8 seconds instead of asking.

      Can I use it with the keyboard?

      Yes. Space or Enter rolls again. The keys 1 to 7 roll d4, d6, d8, d10, d12, d20 and d100, using the count and modifier you set. In the notation box, Enter rolls.

      More from FLXCode

      • Spin the WheelType names or choices, spin, get one at random. Weights, no-repeat draws, saved lists, fullscreen, sound themes.
      • Random Team GeneratorPaste names, get fair teams. Balance by skill, keep pairs together or apart, lock a person, show it on a projector.
      • Probability CalculatorProbability of A or B, A and B, A given B and not A, plus binomial chances for repeated trials, with each step shown.
      • Club CardEvery store loyalty card on your phone, ready to scan at the till.

      Share Dice Roller