This library is a JS based dice roller that can roll various types of dice and modifiers, along with mathematical equations.
It's main purpose is for use in pen and paper / tabletop RPGs, like Dungeons & Dragons, Pathfinder, Cyberpunk, Warhammer etc., where players have to roll complicated combinations of dice.
How it works
Dice can be rolled through the use of "notations", which are strings of characters that tell the parser which dice and modifiers to roll.
You can read more about it in the Notation section.
How random is it?
This library uses psudeo random number generation (PRNG) to determine die rolls. It is not true random but it is suitable for most purposes. PRNGs are used globally for computer-based random number generation.
It is more than sufficient for the vast majority of uses. However, if your needs require, you can modify the RNG engine.
Different dice types
- Keep rolls
- Drop rolls
- Target success
- Target failure
- Sort dice
- Group rolls New
Usage in the wild
- Vue components - For Tailwind, Bootstrap, basic HTML, and renderless
- Vuepress plugin - Dice roller plugin used in this documentation
- CLI New - Command Line Interface for rolling dice
This library uses ES6+ and native JS modules, which work in all the latest browsers, and Node.js.
We also provide a bundled UMD version that can be used in environments that don't support ES modules.
We actively support the latest versions of Firefox, Chrome, Opera, Safari, Microsoft Edge, and Node.js.
We only support Node.js >= 12. There's no guarantee that it will work on older versions.
We do not support IE, and the library will not work in IE (Check out Microsoft Edge instead!).
It may be possible to make it work by creating polyfills for functionality that is missing in IE, but we cannot guarantee it.