Dice Roller
Roll d4-d100 with dice notation (3d6+2), advantage/disadvantage, keep-highest. Crypto.getRandomValues for unbiased rolls. Free, offline, client-side, instant, secure.
Roll dice with standard RPG notation (1d6, 3d20+2, 4d6k3 for D&D ability scores, 2d10-1), advantage/disadvantage for d20, cryptographically unbiased RNG via crypto.getRandomValues, and roll history with session stats.
Roll history (last 20)
How to Use Dice Roller
- Enter dice notation: standard RPG format like
1d20(one twenty-sided die),3d6+2(three d6, add 2),4d6k3(roll four d6, keep highest 3 - D&D ability score generator),2d10-1(two d10, subtract 1),6d6kl3(keep lowest 3). - Or load a common roll from the dropdown.
- For a single d20 roll, tick Advantage (roll 2, keep higher) or Disadvantage (roll 2, keep lower). Toggling one disables the other.
- Click Roll (or press Ctrl+Enter). Each die appears as a card with its value; dropped dice (in keep modes) are shown faded.
- Read the total (sum of kept dice + modifier). Session stats update: total rolls, cumulative sum, running average.
- The roll history shows the last 20 rolls with their full breakdown. Copy or download for record-keeping.
- An indicator shows whether
crypto.getRandomValuesis active (๐) or fallbackMath.random(โ ).
Frequently Asked Questions
What’s the difference between Math.random and crypto.getRandomValues?
Math.random(): pseudo-random from an unspecified PRNG (typically xorshift128+). Statistically OK for games but PREDICTABLE – an attacker who sees enough output can recover the seed and predict future values. NOT suitable for cryptography, gambling stakes, fairness-critical applications. Also susceptible to modulo bias when reduced to small integer ranges.
What’s “keep highest” / “keep lowest” notation?
Standard RPG convention. 4d6k3 means “roll 4 six-sided dice, keep the highest 3”. Used in D&D 5e for ability score generation (the classic “roll 4d6 drop lowest” method). 4d6kl3 would keep the LOWEST 3 (less common, used in some gritty house rules). The dropped dice are still visible in the output, just marked as not contributing to the total.
How does Advantage work?
D&D 5e mechanic: when you have advantage on a d20 roll, you roll twice and take the higher result. Disadvantage: roll twice, take the lower. The tool simulates this by rolling 2d20 internally and selecting based on the toggle. Only valid for single-d20 rolls – the toggles are ignored for other notations like 3d6 or 1d100.
What modifiers can I add?
Integer add/subtract via standard notation: 1d20+5 (attack with +5 bonus), 2d6+3 (longsword damage), 3d8-2 (negative modifier). The modifier is applied to the TOTAL, not each die. Roll 3d6+2: dice show [3, 5, 1], sum is 9, total is 11. Modifier can be negative; total can go below zero.
What’s modulo bias and why does this tool avoid it?
When reducing a uniform 32-bit random integer to a small range (like 1-6) via the modulo operator v % 6, certain values appear slightly more often because 2^32 isn’t evenly divisible by 6. The bias is tiny (~1 in 715 million) but real, and accumulates over many rolls. The tool uses rejection sampling: if the random value falls into the “biased” upper region, it’s discarded and a new value drawn. Result: provably uniform output.
How large can my dice notation be?
Count: up to 1000 dice in one roll. Sides: up to 10000 per die. The tool will roll all of them in <5 ms on a typical desktop. The display shows all individual die values up to a reasonable cap – for very large rolls (1000d20), the dice grid may scroll. The history limit is 20 (older rolls discarded).
What’s the session-stats card showing?
Rolls this session: how many roll-button presses since you loaded the page (or last Reset). Sum of totals: cumulative sum of every “Total” you’ve rolled. Average: sum รท count. Useful for “I rolled 50 d20s – what was my average?” probability experiments. For statistical analysis, the Copy / Download buttons give you a full history record.
Can I use this for D&D / Pathfinder / Cyberpunk RED?
Yes. All standard RPG dice supported: d4, d6, d8, d10, d12, d20, d100. Dice notation matches the convention used by Roll20, Foundry VTT, and most virtual tabletops. Advantage/disadvantage covers D&D 5e and Pathfinder 2e (Hero Points have a similar mechanic). For systems with exploding dice (Cyberpunk RED, Savage Worlds), the notation parser doesn’t support that – but you can manually re-roll when needed.
Is my data secure?
Yes. All rolling and history stay in your browser. No data is sent anywhere. The random bytes come from the browser’s CSPRNG (which is OS-level on /dev/urandom or BCryptGenRandom).