Dice Roller

Set the number of dice, sides and modifier — the dice only roll when you press Roll, so changing a setting never replaces a result you are looking at.

How it works

Each die draws a random 32-bit value from crypto.getRandomValues and reduces it to a face with % sides. Because 2^32 rarely divides evenly by the number of sides, a plain modulo would land on the leftover low values slightly more often than the rest — for a d6, roughly one draw in 700 million. Rejecting any draw that falls in that leftover range before the modulo removes the bias, so every face is exactly as likely as every other.

Frequently asked questions

Is this actually random, or just Math.random()?

It draws from the browser's crypto.getRandomValues, the same cryptographically secure source this site's Password Generator uses — not Math.random(), which is fast but never designed to be unbiased or unpredictable enough to rely on for anything fair. Each roll is also checked with rejection sampling, which discards the rare draw that would otherwise favor low faces on dice whose side count does not divide evenly into the random source's range.

Why doesn't changing the dice count or sides reroll the dice?

The settings above are live and validate as you type, but the roll itself only happens when you press Roll — the same reasoning behind this site's Password Generator not regenerating on every keystroke. If adjusting the number of dice reran the roll immediately, you could never change your mind about the sides or modifier without losing the result you were looking at.

What is the modifier for?

Tabletop games commonly add a flat bonus or penalty to a dice roll rather than using the raw total — a notation like "2d6+3" means roll two six-sided dice and add 3 to whatever they total. The modifier field applies that adjustment for you and is shown separately as the total, alongside the unmodified sum of the dice themselves.