BBcode: Dice Roller

Original written by Sai, updated by SoulLink
World Anvil BBCode includes a dice roller. This BBCode creates a button which can be clicked to roll some dice. The result is then displayed in a small pop-up on the screen. Using various different commands you can simulate almost any kind of dice roll! This guide gives a basic overview on how to use this BBCode.

Basic Examples

Code Description Result
[roll:1d4] A normal four sided die. 1d4
[roll:1d%] A percentage die (1 - 100). 1d%
[roll:1dF] A fudge die (six sided die with the values 1, 1, -1, -1, 0 & 0). 1dF
[roll:1d4+5] Add (or subtract) a modifier. 1d4+5

Roll Labels

  You can replace the displayed expression with a custom label by using the pipe separator. This code [roll:1d20|Roll Initiative] will result in Roll Initiative .  

Advanced Examples

Code Description Result
[roll:3d8min3] Rolled results are at least 3. 3d8min3
[roll:3d8max5] Rolled results are at most 5. 3d8max5
[roll:2d6!] Exploding die. Check the documentation for compounding and penetrating dice. 2d6!
[roll:{1d4+5, 2d3}] Group rolls require curly brackets and are separated by a comma. You can apply modifiers to the full expression as well. {1d4+5,2d3}
There are many more modifiers like drop, keep, critical failure & success, sort and more. The full documentation of its capabilities can be found here.

Missing a modifier?

  You can request missing modifiers here. Do not request modifiers with WorldAnvil, as it simply depends on that library.

Guide to BBCode Commands
Generic article | Nov 8, 2020

Using BBCode to format your text and layout



Cover image: Photo by Alex Chambers


Please Login in order to comment!
29 May, 2020 03:18

Do the results show independently or always summed up? I.e. 3d10: 2, 6, 4 OR 12

29 May, 2020 17:44

Both. I added examples to the page.

Admin of the World Anvil Codex & Discord | Director of Ethnis | My Ko-Fi | My Twitter
29 May, 2020 18:43

Thanks Ademal! Any BBcode functionality for re-rolling results?

29 May, 2020 23:36

Can't say that there is!

Admin of the World Anvil Codex & Discord | Director of Ethnis | My Ko-Fi | My Twitter
Master GameKn1ght
Jim "GameKn1ght" Dickinson
2 Jul, 2020 02:04

Love to work out how to roll xd6 and count total face value as one number, and recount the same roll with 1 = 0, 2-5 = 1, and 6 = 2. Is this possible at all?

Master GameKn1ght
Jim "GameKn1ght" Dickinson
2 Jul, 2020 02:12

Is it possible to sort dice roll results from highest to lowest or lowest to highest?

2 Jul, 2020 16:13

I don't believe either of your requests are possible within the current system, no.

Admin of the World Anvil Codex & Discord | Director of Ethnis | My Ko-Fi | My Twitter
14 Aug, 2020 01:12

Hi there, just thought it worth mentioning, I built the dice roller that's used on here and the latest version does support ordering results in both ascending and descending order. It also supports re-rolling, which I noticed another user asked about.   I'm happy to help World Anvil upgrade to the latest version, if you like?

14 Aug, 2020 01:36

How kind of you! I've passed the info off to Dimitris!

Admin of the World Anvil Codex & Discord | Director of Ethnis | My Ko-Fi | My Twitter
20 Aug, 2020 07:24

Rolling with advantage [2d20-L+6] Is it possible to high light rolls with 20?   I mean 20 is critical (crit) in d&d 5e and if I roll with advantage if either dice is 20 it crits and auto succeeds. I can roll 19, 19 and that is 25 or 19, 20 and it is instant hit and crit. So I would need highlight when I roll 20.   Why I want highlight? I already spend time for barbarian tavern brawler making 12 differend rolls I can make just to attack with no weapon. Normal attack, reckless attack, rage and reckless while raged. Each add either advantage or more dmg to the roll. When I roll 2d20 and 1d20 I need to first check if the roll is 20 and then if it is not look at the end what the result of roll was -> I have Dyslexia and the time it spends is way too fast. and if it is rolled with disadvantage I need to the hit with 2d20-H+6 and rolls of 1 I need to again single out. Just rolling d20 you can see if it is 20 or 1 before you make the calculation with your + to hit. I wondered if I could add all this stuff in to a rolling a dice.   Like "I have weapons and then I can do X things to change the rolls." but high light on roll max / min would help to read . . . like if I roll 20 it should say crit in the end if I designed it to do so but I don't believe this is this complex?

17 Nov, 2020 12:01

Hi wizardxeze   Sorry for the very late reply! With the new dice roller this should all be possible. Check out the guide and the technical documentation.