Dice Notation

Reference for what you can write in a roll formula, such as 4d6kh3, exploding dice, rerolls, groups and math.

Works on the web and on iPhone and iPad.

A formula is dice and numbers, optionally followed by a check clause. The shorthand follows Roll20, so most formulas you know already work. The same formula works in roll buttons ({{...}}) in notes and chat, and when the AI GM rolls. The /r command takes only a small part of it: see Roll With a Command.

The developer docs have the same reference at /developers/dice.

Dice

WriteMeaning
d20, 2d6One d20; two six-sided dice, totaled
d% or d100Percentile
dFFate/Fudge die (-1, 0, +1)
d20+5, 2d6+d8+3Add numbers and other dice
2d6*2, (d8+2)*3Multiply, divide, and use parentheses
floor(3d6/2)floor, ceil, round and abs

Division is not rounded unless you wrap it in one of those functions. A die needs at least one side and a group at least one die.

Keep and drop

WriteMeaning
4d6kh3 or 4d6k3Keep the highest 3
2d20kl1Keep the lowest 1 (disadvantage)
4d6dl1Drop the lowest 1
4d6dh1Drop the highest 1
2d20kh1Keep the highest of two (advantage)
{4d6, 3d8}kh1Roll several groups and keep the best across them

Exploding, rerolling and successes

WriteMeaning
d6!Exploding: a maximum roll rolls again and adds
d6!!Compounding: the extra rolls add into the same die
d6!pPenetrating
d6!>5Explode on a chosen compare point
d6r1Reroll any 1 and take the new value
d6ro<2Reroll a 1 or 2 once, then keep what comes
5d10>=8Count dice that meet the bar as successes
10d10>=8f1Count successes and subtract failures
d20cs20cf1Mark a 20 as a critical success and a 1 as a fumble
4d6sSort the dice (sa ascending, sd descending)

Compare points on dice (explode, reroll, success, crit and fumble marks): > and < include the number, so >8 means 8 or higher. A bare number means exactly that number. Inside a count clause > and < are strict, so write count >=4 to include the 4.

Explosions and rerolls repeat at most 99 times per die, then stop.

Labels on dice

A label in square brackets names a die: d20[attack], d[hope]. It attaches to a die, not to a flat modifier, so 2d6[damage]+3 works and 2d6+3[damage] does not. To label a whole roll on a button, use {{formula|label}}.

Check clauses

Add one of vs, under, bands, count, best, margin or beats after the dice, and the roll judges itself. See Write a Roll That Judges Itself.

Limits: a roll takes at most one of vs or under; at most one of count, bands, best or margin (with the exception that best pairs with bands); and one beats. margin and /N band ranges need a vs or under beside them.

Values from a sheet

d20+@Might reads the number called Might. This works in notes, where the name is declared as a field. In chat the number has to be written out. See Use Fields and References in Notes.

If a formula is rejected

An unknown character, an unclosed [, or a clause in the wrong place makes the formula invalid, and the roll does not run. The AI GM can write or fix a formula for you if you describe the roll.