Dice Notation Roller
A real tabletop dice notation parser: type 3d6+2, 4d6kh3 or adv and get every individual die roll, kept/dropped dice and the total.
Result
Dice Notation Roller reads and rolls the same shorthand used at tabletop RPG tables and in rulebooks: "NdS" means roll N dice with S sides, so "3d6" rolls three six-sided dice. Add a flat modifier with +N or -N ("3d6+2"), combine several dice groups in one expression ("2d8+1d6-1"), or use the D&D 5e advantage/disadvantage shorthand ("adv" rolls two twenty-sided dice and keeps the higher one, "dis" keeps the lower one). Keep-highest and keep-lowest notation ("4d6kh3" rolls four six-sided dice and keeps the highest three — the standard way to roll D&D ability scores) is fully supported too.
Under the hood this is a genuine tokenizer and parser, not a list of recognized expressions: the notation is scanned character by character into tokens (dice groups, adv/dis keywords, plain numbers and +/- operators), assembled into a small expression tree, and only then evaluated. Any syntactically valid combination works, including notation nobody wrote an example for. Every die is rolled with the browser's cryptographic random number generator (crypto.getRandomValues, not Math.random) using rejection sampling so every face has an exactly equal chance, and the result shows each individual die, which dice were kept or dropped for kh/kl rolls, the modifier applied and the final total.
To keep the tool predictable and fast, dice groups are capped at 100 dice and 1000 sides per group, and keep-highest/lowest counts can never exceed the number of dice rolled. Malformed notation — an unknown character, two operators in a row, a dangling + at the end — produces a specific, readable error message instead of a silent failure or a crash. Everything runs locally in the browser: no notation, roll or result is ever sent anywhere.