Introduction

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 pseudo random number generationopen in new window (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.

Features

Different dice types

Roll modifiers

Advanced

Mathematical equations

Customisation

Usage in the wild

Official

Environment support

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.

Node.js

We only support the current Node LTS releaseopen in new window and newer. There's no guarantee that it will work on older versions.

Supported node version

Internet Explorer

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.