---
canonical: "https://nicolamustone.com/opendice-rollful/"
description: "Roll dice in JavaScript or TypeScript with a formula parser and a single roll() function backed by a CSPRNG with modulo-bias rejection."
launched: "2026-08-06"
status: "active"
tags: ["API","App","npm"]
---

# OpenDice & Rollful

API / App / npm / Aug 2026

Roll dice in JavaScript or TypeScript with a formula parser and a single roll() function backed by a CSPRNG with modulo-bias rejection.

[GET rollful.dev/ – 200](https://rollful.dev/)

![The Rollful dice rolling interface.](https://nicolamustone.com/_astro/content-1.bNgwqnVO_1T892E.jpg)

OpenDice began inside [OpenFray](https://nicolamustone.com/openfray-app.md). I needed a dice engine that could parse the expressions used in tabletop games: rerolls, exploding dice, keep and drop modifiers, advantage, disadvantage, and nested formulas. It also had to produce predictable results for the game mechanics built around it.

I initially developed the engine as part of the application, then extracted it into [an open-source npm package](https://www.npmjs.com/package/opendice). JavaScript and TypeScript projects can now use the same parser and call a single `roll()` function rather than implementing each rule independently.

**Rollful** makes that engine available without installing a package. It provides a hosted API and a small web interface where you can enter a dice expression and inspect the result. The website also works as an interactive playground for the API because both use the same OpenDice implementation.

The two projects offer different ways into the same engine. OpenDice runs directly inside an application; Rollful can be called over the web or used from a browser. Keeping the parsing and rolling logic in one place means both interfaces support the same expressions and return results in the same format.

## Notable bits

- From OpenFray to everywhere. A dice engine extracted from a real-world application into an open source library and hosted service.
- Supports the full language of dice. Exploding dice, rerolls, keep/drop modifiers, custom functions, and more.
- OpenDice at its core. Rollful is powered by the exact same engine, not a separate implementation.
- Test in the browser, integrate anywhere. One interface for humans, one API for applications.
- Lightweight by design. No accounts required, no unnecessary complexity, just reliable dice rolling.

## THE STACK

- **Frontend:** Astro, Astro Starlight, TypeScript, Tailwind CSS, Vite

- **Backend:** OpenAPI

- **Hosting:** Cloudflare Pages

- **Tools:** GitHub, GitHub Actions, npm, Prettier

## Related projects

- [OpenFray.app The D&D combat console where the OpenDice engine began.](https://nicolamustone.com/openfray-app.md)

[← Back to all projects](https://nicolamustone.com/index.md#projects)
