Dice Notation
Reference for what you can write in a roll formula, such as 4d6kh3, exploding dice, rerolls, groups and math.
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
| Write | Meaning |
|---|---|
d20, 2d6 | One d20; two six-sided dice, totaled |
d% or d100 | Percentile |
dF | Fate/Fudge die (-1, 0, +1) |
d20+5, 2d6+d8+3 | Add numbers and other dice |
2d6*2, (d8+2)*3 | Multiply, 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
| Write | Meaning |
|---|---|
4d6kh3 or 4d6k3 | Keep the highest 3 |
2d20kl1 | Keep the lowest 1 (disadvantage) |
4d6dl1 | Drop the lowest 1 |
4d6dh1 | Drop the highest 1 |
2d20kh1 | Keep the highest of two (advantage) |
{4d6, 3d8}kh1 | Roll several groups and keep the best across them |
Exploding, rerolling and successes
| Write | Meaning |
|---|---|
d6! | Exploding: a maximum roll rolls again and adds |
d6!! | Compounding: the extra rolls add into the same die |
d6!p | Penetrating |
d6!>5 | Explode on a chosen compare point |
d6r1 | Reroll any 1 and take the new value |
d6ro<2 | Reroll a 1 or 2 once, then keep what comes |
5d10>=8 | Count dice that meet the bar as successes |
10d10>=8f1 | Count successes and subtract failures |
d20cs20cf1 | Mark a 20 as a critical success and a 1 as a fumble |
4d6s | Sort 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.
Related Articles
- Write a Roll That Judges ItselfAdd vs, under, bands, count, best, margin or beats to a roll so it shows a hit, a degree of success or a count of successes.
- Add Roll Buttons to Notes and ChatWrite {{2d6}} in a note or chat message to make a clickable roll button, add a label, and know why an @ roll shows as braces in chat.
- Roll With a CommandType /r or /roll with dice notation in the chat box to roll without touching the dice tray, and what the command can and cannot parse.
- Roll DiceHow to roll dice at the table with the dice tray above the chat box, and what happens to the result.
- Use Fields and References in NotesTurn a note into a character sheet with {{Name = value}} fields, @references in rolls, and depletable pools.