How To Roll Dice in Roll20

Rolling dice is one of the most common things you’ll do in Roll20 as a GM or as a player. You can make all sorts of rolls in Roll20 and do some amazing things, but it can be hard to know exactly what you can do. Everything on this page is also on the Roll20 Wiki and can be found there – if you already know what you’re looking for. The wiki is much better organised now than it was in the past (thank you Andreas!), but it would still be handy to have everything related to dice rolls on one page. So that’s what this post is.

This is an extremely comprehensive post and might not be easy reading, but I hope it’s a great reference.

Counting Dice

When a line begins with either /roll or /r whatever follows is a dice roll. Dice are shown as NdX or NDX, where N is the number of dice and X is the size of those dice. So 3d6 is a roll of three six-sided dice. This should be pretty familiar to most roleplayers.

/roll 3d6
/r 1d20+4
/r d8 + d6 + 2d4
/r d10 * d6 - d20Code language: Markdown (markdown)

By default, rolls are simply added up. A 3d6 roll is shown at the right:

You can use dF for the Fudge Dice used in the Fudge and Fate systems. These are special d6, where every 2 faces show +, 0, or -, meaning each die can give +1, +0, or -1. A Typical roll is four fudge dice.

/r 4dFCode language: Markdown (markdown)

If you want to count successes, this is easily done. Just use >target, like >7. You can use =, >, and <. In Roll20, the > and < symbols include equal values. On a d6 roll >5 means 5 and 6, not just 6.

/roll d10>7
/r d6=6
/r d20<12Code language: Markdown (markdown)

When building a dice expression, avoid spaces!

By default, Roll20 shows maximum values (critical) on a die in green, and minimums (fumbles) in red.

You can set your own ranges with cs and cf, and can have overlapping zones (shown in blue).

If you don’t want criticals or fumbles to be shown, set a number that can’t be rolled on the die.

You can combine these with counting successes – dice expressions can get complicated.

/roll 6d10cf<2
/r 1d20cs10
/r 2d6cs>5cf<2
/r 3d6cs>3cf<4
/r 6d6cs10cf0
/r 3d6>3cs>5Code language: Markdown (markdown)

Many systems have exploding dice – where you roll extra dice if the dice rolled maximum or in a range. Show these with !. By default, dice explode on maximum, but you can declare a result or range.

You can combine mix and match with others, but need to be careful about the order.

Exploding dice give extra dice. If you want the extra dice to make a bigger die, use !! (e.g. in Shadowrun, rolling a 6 means you roll another die and add to the original die).

All extra dice can have a -1 applied, by using !p (Penetrating dice).

/r 3d6!
/r 2d10!=1
/r 5d10!>7
/r 5d10!>7
/r 5d10>7cs>9!>7
/r 7d6!!
/r 5d6!!>5
/r 6d10!p
/r 5d8!p>7Code language: Markdown (markdown)

Use r to reroll dice (and can use < or > to create a range. Rerolled dice replace the dice they rerolled. Unlike exploding, they are not added in.

Any rerolled dice can themselves reroll. If you want to reroll dice only once, use ro.

You can as usual combine with other reroll types, but when counting successes, that comes first. Others can be in any order.

Be careful: If combining exploding dice and reroll, the reroll triggers if the exploding die is in the reroll range, and can remove a large !! roll. So that’s not a good combination.

/roll 3d6r1
/r 3d6ro1
/r 8d10r<2
/r 6d8>7r<2
/r 6d10>8cs>9!!ro<2
/r 6d10>8ro<2!!cs>9Code language: Markdown (markdown)

A roll can perform arithmetic. For example

/r 6+4
/r 6 * (5-2) + 4Code language: Markdown (markdown)

Rolls obey normal arithmetic order of operations (PEMDAS/BODMAS). You can do + – * /, but also ** (raise to the power of) and % (divide by the amount and report the remainder).

Using parenthesis is very handy for organising rolls.

You can also round expressions in three ways:

  • round( ) – round to the nearest
  • floor( ) – round down
  • ceil( ) – round up

You can drop some dice, or keep only some dice. d3 means to drop the 3 lowest dice, and k3 means keep only the 3 highest dice.

Use dh or dl to drop the highest or lowest dice, and kh or kl to keep only the highest or lowest dice.

It’s very common to combine this with a grouping roll…

/r 6d10k3
/r 2d6d1
/r 2d6dl1
/r 2d6kh1
Code language: Markdown (markdown)

You can group similar rolls together. Like, 5 bandits are attacking the fighter and you count how many hit.

A roll like /r {5d20}>13 takes the >13 difficulty test and applies it to every roll in the set. Surround a group roll with curly brackets { } and apply rules to the brackets.

/r {5d20}>13
/r {7d20+5}>15
/r {1d8,1d6}kh1
/r {3d6,4d8}kh1
/r {1d10,{10}}dh1Code language: Markdown (markdown)

You might also want to make a Savage Worlds roll, where you roll a die of any size and a wild d6, and take the highest: /r {1d8, 1d6}kh1.

You cant combine numbers and dice. You can trick roll20 into treating numbers as dice by wrapping them in { } (e.g. {10}) or adding an imaginary dice roll (7+d0), and you can treat dice as numbers by using inline rolls (see below).

You can count failures just like successes, with f<3 or f1. Each failure counts as -1 success.

/r 7d6>4f1
/r 7d10>10f<6 + 7Code language: Markdown (markdown)

A common request is for rolls where you can fail, succeed, or get critical successes where rolling max gives 2 successes. You can achieve this with a little creativity. Since a roll generates 0, 1, or 2, you can do this with successes and failures (generating -1, 0, or 1 per die) than adding the number of dice. So something like /r 7d10>10f<6 + 7.

You can also use a Rollable Table (see below).

The easiest thing you can do is simply add sa or sd (sort ascending or sort descending) to the end of the expression, and this shows the dice in order of their size.

When it’s important to visually pick out the dice, this is the way to go.

Getting Values From Sheets

In theory, you can call a character’s attribute with the attributes name, like @{strength}.

The problem is you need to tell Roll20 which strength attribute to use – there are likely multiple character sheets each with a strength attribute. That’s where these tabs come in.

You can supply a name like @{bob|strength}. The name should match the character sheet exactly (though the case doesn’t matter). If you have a character sheet named Bob The Builder, the call would be @{Bob The Builder|strength}.

Names can include spaces and other special characters – but it’s better to just stick with spaces. Others can cause problems.

Supplying a character name is very specific, and those attribute calls only ever apply to that person. But if a token Represents a character, you can use selected, like @{selected|strength}.

This is very handy for creating rolls which will work for any character. Just select them and make the roll.

Target works just like selected, except you are prompted for the target after starting the roll. You can use this to target characters you don’t control, and is handy for attacking opponents: @{target|armour class}.

You can build a roll that targets multiple opponents, but you must give each foe a description: @{target|foe1|armour class}. The actual name of the descriptor can be anything, it just has to be there if you have multiple targets,

How to Display Dice Rolls in Chat

The basic /roll method of rolling dice is kind of ugly. Luckily there are other ways to present the output. Most of these deserve a full post and may be expanded on later.

Instead of using /r, you can enclose a roll in inline roll brackets [[ ]], like [[1d20+6]]. Only the result is displayed – and you can put it inline (hence the name) with text.

If you want to see how the roll was made, hover over the result – as has been done above.

Inline rolls are often combined with roll templates.

You can include descriptive tags in a roll to label parts of it.

Let’s say you have a complex roll made up for your level, strength bonus, and a flaming sword, and want to know which is which. See the labels in brackets to the right.

The roll for that (in simple form, and in inline roll form) is:

/roll 1d20 [attack] + 4 [strength] + 1d6 [flame]
[[1d20 [attack] + 4 [strength] + 1d6 [flame] ]]Code language: Markdown (markdown)

Tags are words or phrases inside single square brackets, and you can include them in normal or inline rolls. You can also add spaces to help break the roll up and make it easier to read.

A roll template is a built-in way to display rolls in chat. Many sheets have their own roll templates, each of which is set up differently, but the default roll template is always available. It looks like this:

&{template:default} {{name=Sample Roll}} {{first roll=[[1d6]]}} {{Exploding!!=[[7d10>11!!sd]]}}Code language: JavaScript (javascript)

Here’s what that roll looks like:

You start by naming the inline roll &{template:default}.

Each entry after that looks like {{KEY=VALUE}}. The key is sometimes a line title, but a key of name declares that the value is a title.

Any rolls must be in inline roll brackets, or they display just as text. You can learn more on the wiki page on Roll Templates.

Some rolls can’t be created using Roll20 dice rolls but can be created as rollable tables.

Let’s say we want a d10 roll that succeeds on 7-9, gives 2 successes on 10, and a botch on 1 subtracts 1 success. First, we analyse the die, and find:


Count how many times each result appears – that is the Weight. Then enter them in the table like so:

Name the table, then you can call it in dice rolls. This table is named d10, so rolls are /r 5t[d10]. You can make inline rolls [[ 5t[d10] ]] – the spaces here are to make it easier to read. Use them when you can.

A macro can contain a dice roll, but can also include any text. For instance:

I shout at my enemy!
&{template:default} {{names=attack}} {{roll=[[2d6>4]]}}Code language: JavaScript (javascript)

You can call macros with #macro-name (hash followed by macro name).

Macros can contain line breaks, and even calls to other macros – though that can get tricky (see HTML Entities).

Create macros on the macro pane, shown to the right. Make sure Show Macro Quick Bar is checked – this creates a bar along the bottom of your screen where you can drag macros ttheir for quick access.

You can find the Abilities frame on the Attributes & Abilities tab of your character sheet. There you can create macros personal to that character. They are called Abilities, but they work exactly like Macros, but you call them with a different syntax: %{character-name|ability-name}, so an ability named Attack on Bob’s sheet would be called with %{bob|Attack).

If you want to call any attributes on that sheet, don’t specify the character- Roll20 defaults to the same character. So if you wanted to use Bob’s Strength, you can just use @{strength} instead of @{Bob|strength}.

You can still call attributes from other sheets if you supply their name, selected, or target, as described above.

So remember: @ for Attributes, # for Macros, and % for Abilities.

Character sheets often have buttons – you just click them and something happens. Treat them exactly like Character Abilities – find their name and call them with %{identifier|button-name} – identifier is the character name, selected, or target.

Finding the button name can be tricky. The easiest way is to make sure your macro bar is showing, and drag the button down to it. The full name of the Button will be shown. Here I am dragging a Tinkering button to the macro bar.

Abilities appear with Name: Button-Name. This refers to an Ability %{Boj|tinkering}. Replace the colon with |.

A nifty thing you can do is create buttons in chat that can be clicked by anyone (though you might want to use Secret rolls to make sure only you can click them – see below).

You can call any ability (buttons on a sheet or Abilities) but have to use a special syntax: [visible text](~identifier|button-name)

For example, let’s so you have this in chat:

That is created with the text: I want to click [this button](~some identified|some ability).

You can create buttons to launch any Ability or Sheet Button, and enter them in other Macros or Abilities.

You can use Chat Buttons and Roll Templates to create a Chat Menu – a group of related buttons using a roll template. Say you have three abilities, Charisma, Fighting, and Tinkering, and create the following Macro:

&{template:default} {{name=A menu of Buttons}} {{[Charisma](~selected|charisma)
[Fighting](~selected|fighting) [Tinkering](~selected|tinkering) }}Code language: Markdown (markdown)

That would look like this:

Because it uses selected, anyone could click it, and if their token is selected, it launches the ability from their sheet. Chat menus like this are a great way to provide quick ass to a character’s abilities and have many more uses. For more information, see Chat Menus on the wiki.

If you want to whisper a roll to another character or the GM (or yourself if you are the GM), you can use a Secret roll. These can be used for normal chat too, it’s not just for rolls. The format is:

/w "character or player name" "text or roll"
/w bob look at this, bob!
/w gm Bob's perception roll: [[1d20+@{bob|perception}]]Code language: JavaScript (javascript)

When you whisper, only you and the recipient can see it. If you are a player and whisper to another player, the GM can’t see it.

The GM can also use /gmroll or /gr to make rolls only they can see.

Roll Queries

Sometimes you want to prompt the user for a value.

/r 1d20+?{Bonus}Code language: Markdown (markdown)

The text between the curly brackets is the prompt the user will see:

You can enter a default value, that will already be filled in. Say you want to show a value of 0, like this:

You do this by |0 to the prompt, like so:

/r 1d20+?{Bonus|0}Code language: Markdown (markdown)

Maybe you want to prompt for the roll of a d6. You could just use a prompt like before, or you could limit it to specific values with a dropdown list:

/r 1d20+?{Bonus|1|2|3|4|5|6}Code language: Markdown (markdown)

The user can only pick from the list. This helps the user avoid typos (if entering text) or enter numbers only in the allowed range. It’s very useful.

You might want the text shown to the user to be different from the value used.

/r 1d20+?{Bonus|One,1|Two,2|Three,3|Four,4|Five,5|Six,6}Code language: Markdown (markdown)

Notice how the list displays the Label, but the roll will use the Value (which is a number here).

Separate Labels and values with a comma.

You can make it easier to read a query by putting a linebreak after the | symbol, like this:

/r 1d20+?{Bonus|
Six,6}Code language: Markdown (markdown)

A line break usually ends the roll command, so this is handy.

In the Previous examples, the Query is called Bonus. That is the Title of the query. You can reuse that query in a roll, and it has the same value the user enters. So, imagine you did this:

/r 1d20+?{Bonus|
Six,6} + ?{Bonus}Code language: Markdown (markdown)

The user would see the prompt once, pick a value, and then that value is used again each time a query named Bonus is seen. So, this is a long-winded way of doubling the Bonus query.

Be careful with special symbols in query names.

/r 1d20+?{Bonus?|0}Code language: Markdown (markdown)

Here the name or title of the query is Bonus? including the question mark. If you want to refer to the query again, use the full name:

/r 1d20+?{Bonus?|0}+?{Bonus?}Code language: Markdown (markdown)

You can include roll and macro text inside a query.

I want to pick one of two roll types. ?{Roll Type|
D6,/r 1d6|
A Label and a D6,Rolling D6
/r d6}Code language: Markdown (markdown)

Everything after the comma is treated as macro text. This means the linebreak after “the “Rolling D6” is part of the output!

This can be a bit mind-bending but opens up a huge range of possibilities. But there are also problems which I might cover in a future post. For now, see the wiki’s page on Advanced Queries. (Generally, I advise against Nested Queries for any but the simplest options – the Macro Buttons described above are much, much easier.)

Using the Turn Tracker

This page won’t describe the Turn Tracker in detail, but there are rolls you can do with it.

First, if you select a token, make a roll, and include &{tracker} in the roll, it’ll be added to the Turn Tracker.

/r 1d20+6 &{tracker}Code language: Markdown (markdown)

Many character sheets will have an initiative button that does this for you.

If you have a token selected, and make another initiative roll, it either adds that token to the Turn Tracker, or replaces the existing initiative. So you can have everyone take their actions for the turn, and have them make new initiative rolls (if appropriate for your system).

If you use &{tracker:+} or &{tracker:-} the roll doesn’t replace the existing initiative – it adds to it or subtracts from it.

A “roll” can be a fixed number, but must still be a “roll”.

/r 5 &{tracker:-}
/r 1d6 &{tracker:+}Code language: Markdown (markdown)

You can call a specific token’s initiative, and use this in rolls. Let’s say you have the initiative to the right:

Then you can call that in chat:

@{tracker|Fred}Code language: Markdown (markdown)

And can use it in rolls:

/r 1d6+floor(@{tracker|Fred}/5)Code language: Markdown (markdown)

There are a lot of advanced tricks you can do with the Turn Tracker, especially in games where you aren’t using it for Initiative. See Turn Tracker on the Roll20 Wiki for more (including my own Reusing Last Roll trick).

Reusing Rolls

Reusing Rolls is the term given by the community to a technique that may be the result of a bug. It’s not officially documented but is so powerful it needs to be covered. It might get its own post – it deserves one.

Reusing Rolls requires the use of Inline Rolls, and is usually done in a Roll template.

Note that all parts of a Reused Roll must be on the same line.

Roll20 appears to identify each inline roll on a line – the first is $[[0]], the second is $[[1]], the third $[[2]] and so on. If you have inline rolls inside other inline rolls, count the innermost first.

[[1d20+ [[1d12 + [[1d10]] ]] + [[1d8]] + 1d6]]Code language: JSON / JSON with Comments (json)

In the extremely confusing roll above, $[[0]] (first, innermost) is the 1d10 roll. The 1d12 +1d10 and 1d8 are at the same ‘depth’, and the d12 is listed first, so 1d12 +1d10 is $[[1]] (it is the whole inline roll), and 1d8 is $[2]]. The d6 isn’t inside its own inline roll so it can’t be addressed in this way. Finally, the whole roll starting with the 1d20 is $[[3]].

identifying and keeping track of each inline roll is a skill in itself – remember, this is not an officially supported technique.

A good, practical example comes from a question that is asked occasionally on the forums: “I want to roll each of the 6 stats, and also count up their totals”.

This isn’t possible with standard rolls. A roll can be used only once for one thing – so if you want to know what one of the stats is, you can’t also include it in a total. That’s a separate roll.

But with reusing rolls, you can do this:

&{template:default} {{name=Stats}} {{total=[[ [[4d6kh3]] + [[4d6kh3]] + [[4d6kh3]] + [[4d6kh3]] + [[4d6kh3]] +[[4d6kh3]] ]] }} {{STR= $[[0]]}} {{DEX= $[[1]]}} {{CON= $[[2]]}} {{INT= $[[3]]}} {{WIS= $[[4]]}} {{CHA= $[[5]]}}Code language: Markdown (markdown)

That would give something like this:

There are a lot of ways to use this technique. You can find out more, as ever, on the Roll20 Wiki, under Reusing Rolls.

Wrapping Up

There is a lot more you can do with roll20 rolls (like including images). There’s also a lot you can’t do. If you want to know your limits, it’s handy to look at the Roll20 Wiki, especially the Dice Reference page.

Series NavigationEssence 20 Dice Rolls for GI Joe RPG >>

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.