Dice Roller

A dice roller is a digital randomizer that simulates rolling physical dice.

It is useful when you do not have dice on hand, when you want to roll many dice at once without counting, or when you want results you can record and share. This tool rolls any standard polyhedral die — d4, d6, d8, d10, d12, d20, or d100 — up to 20 at a time, with an optional modifier added to the total. A second tab flips up to 100 coins at once and reports heads, tails, percentages, and the longest run of each face.

Unlike many online dice rollers, this tool does not use JavaScript’s Math.random(). That function is a pseudo-random generator designed for speed, not fairness, and its output is not uniformly distributed in subtle ways that matter when you start stacking many rolls. Instead, this roller uses crypto.getRandomValues() — the browser’s cryptographic random source, backed by your operating system’s entropy pool — combined with rejection sampling to eliminate modulo bias. Every face of every die has exactly a 1-in-N chance of coming up.

Use it for tabletop role-playing games like Dungeons & Dragons or Pathfinder, for board games where you have lost a die, for classroom lessons on probability and the law of large numbers, for raffles and drawings, or any time you need an honest, unbiased random result.

How the Dice Roller Works

Each time you press Roll Dice, the tool reads the die type, count, and modifier you selected, then asks the browser’s cryptographic random generator for one fresh integer per die. For a d6, it asks for a number between 1 and 6. For a d20, between 1 and 20. The individual results are shown as tiles so you can see each roll, and the sum is displayed separately from the total (sum plus modifier) so you can spot critical hits, critical failures, and natural rolls at a glance. The last 20 rolls are kept in a history log so you can compare results across rounds of a game or over a probability experiment.

Why Cryptographic Randomness Matters

Most programming languages ship with a fast pseudo-random number generator — in JavaScript, that is Math.random(). It is perfectly adequate for animations or procedural graphics, but it has two problems for a dice roller. First, it is seeded deterministically, so an attacker or bug can in principle predict its output. Second, and more commonly, developers scale its output to an integer range using the modulo operator (Math.floor(Math.random() * 6) + 1). When the range does not divide evenly into the generator’s internal space, some outcomes become slightly more likely than others. That skew is called modulo bias.

This tool uses crypto.getRandomValues(), which fills a typed array with bytes drawn from the operating system’s entropy pool — the same source that seeds your TLS connections and password generators. Then, to convert those 32-bit numbers into, say, a d20 roll, the tool uses rejection sampling: it discards any raw value that falls above the largest exact multiple of 20 that fits in 32 bits, and retries. The result is a perfectly uniform integer on [1, 20]. No bias, no predictability. If you want to verify, the code is visible in app.js in your browser’s developer tools.

Standard Dice Types Explained

Each polyhedral die has a specific shape and role in game design.

  • d4 (tetrahedron). Four triangular faces. Used in D&D for daggers, magic missile damage, and small healing spells.
  • d6 (cube). Six faces, the familiar cube. Used in Monopoly, Yahtzee, Risk, Catan, and most classic board games, plus many skill checks and damage rolls.
  • d8 (octahedron). Eight faces. Used for longsword damage in D&D, and by some collectible card games for health or damage tracking.
  • d10 (pentagonal trapezohedron). Ten faces numbered 0-9 or 1-10. Used alone for percentile checks (pair of d10s generates d100) and in White Wolf’s Storyteller system.
  • d12 (dodecahedron). Twelve faces. Used for greataxe damage and barbarian hit dice in D&D.
  • d20 (icosahedron). Twenty faces. The defining die of Dungeons & Dragons fifth edition and the d20 system: almost every attack, saving throw, and skill check rolls a d20.
  • d100 (percentile). One hundred possible outcomes, usually rolled as two d10s (tens and ones) but simulated here as a single 1-100 number. Used in Call of Cthulhu, Warhammer Fantasy Roleplay, and Rolemaster.

Coin Flip Statistics

A fair coin has two outcomes, each with probability 0.5. Over a large number of flips, heads and tails both approach 50 percent — this is the law of large numbers. But over short runs, streaks are surprisingly common. In 100 flips of a fair coin, the expected longest streak of heads is roughly six in a row, and streaks of eight or more are not at all unusual. The Coin Flip tab reports both longest streaks so you can see this statistical truth in action.

This is why sports fans famously mis-remember streaks as "hot hands" or "cold streaks" when they are simply the normal variance of a random process. Flipping 100 coins and finding no streak longer than four would actually be suspicious evidence that the coin is not fair.

Use Cases

Tabletop gaming. When your physical dice go missing, when your gaming group is online, or when you need to roll 15d6 for a fireball and do not want to count pips, a dice roller saves time and reduces math mistakes. The modifier field handles skill bonuses (1d20+7 for a strength check) and damage bonuses (2d6+4 for a greatsword).

Probability education. Teachers use dice and coin-flip data to introduce expected value, variance, and the law of large numbers. This tool lets a class roll 20 dice instantly and see the sum distribution converge on the theoretical mean, without the physical overhead of hundreds of individual rolls.

Raffles and drawings. For picking 1 of 50 entrants, a d100 halved (round up) works. For picking between two people, a coin flip is the simplest fair procedure.

Fair decisions. Deciding who pays, who drives, or who goes first. A cryptographically secure coin flip is genuinely unbiased — nobody can claim you rigged it.

Frequently Asked Questions

Is this dice roller truly random?

Yes, as random as modern cryptography allows. It uses crypto.getRandomValues(), which draws from your operating system’s entropy pool — the same source used to generate encryption keys — and applies rejection sampling to eliminate modulo bias. Every face has exactly a 1-in-N chance on every roll, with no predictable pattern.

Can I trust the results for gambling or legal decisions?

For casual gaming, probability experiments, and informal decisions, absolutely. For licensed gambling, contractual tie-breaking, or legally binding draws, you should use a certified random number generator audited by a regulator (GLI, eCOGRA, etc.) or a notarized physical process. This tool is for education and entertainment.

What is the difference between a d6 and a d20?

A d6 is a six-sided cube with results 1-6. A d20 is a twenty-sided icosahedron with results 1-20. D&D uses d20s for attack rolls and saving throws because the wider range gives finer gradation between skilled and unskilled characters, while d6s are more common in board games where simpler outcomes speed play.

How do modifiers work?

The modifier is added to the total sum after all dice are rolled. If you roll 3d6 and get 4, 5, 2 (sum 11) with a +3 modifier, your total is 14. A negative modifier subtracts — 2d8-2 rolling 6 and 3 gives a total of 7. The individual dice are never changed; only the total is adjusted.

What is the longest streak possible in 100 coin flips?

Mathematically, the longest streak can be up to 100 (every flip the same face), but the probability is astronomically small (2 in 2^100). The expected longest streak in 100 flips of a fair coin is approximately log2(100) — around 6 to 7 in a row. Streaks of 10 or more happen roughly 5 percent of the time. Streaks are not evidence of bias.

Do my rolls get saved or tracked?

No. The roll history lives only in your browser tab’s memory. Nothing is sent to a server, nothing is saved to disk, and closing or reloading the page clears history. The tool does not use cookies or local storage.

Data accurate as of: April 2026