Online Dice Roller — Roll d4, d6, d8, d10, d12, d20 & Custom
Roll any standard tabletop die — d4 (tetrahedron), d6 (cube), d8 (octahedron), d10 (pentagonal trapezohedron), d12 (dodecahedron), d20 (icosahedron) or d100 — in any quantity. Each die is rendered as the correct geometric polygon in SVG so the visual matches what's on your physical set, with a colored gradient on each roll for visual variety, and the running sum updates as the dice land. Ideal for D&D, Pathfinder, board games where you've lost a die, statistics class demos, or anywhere you need an unbiased roll without scrambling for physical dice.
About this tool
Each face value is generated by the browser's Web Crypto API (crypto.getRandomValues) with rejection sampling — no modulo bias, every face has exactly equal probability even for d100 (where naive `random() % 100` would skew slightly toward the lower numbers). The visual is real geometry: the d4 is rendered as an actual triangle, the d8 as a square rotated 45°, the d10 as a pentagonal trapezohedron silhouette, the d20 as a decagonal projection, and so on. The roll history keeps every previous roll along with the dice type and sum so you can audit a contested call ('did you really crit?') or reproduce a sequence for a game. Great for tabletop RPGs (D&D 5e, Pathfinder 2e, Call of Cthulhu, Star Wars), board games (Monopoly, Catan, Yahtzee), classroom probability lessons, or any decision that needs more granularity than a coin flip.
- d4, d6, d8, d10, d12, d20 and d100 — every common tabletop die
- Roll 1 to many dice in a single tap
- SVG polyhedron silhouettes match each die's real shape
- Web Crypto entropy with rejection sampling — unbiased even on d100
- Live sum across all rolled dice
- Persistent roll history with die type and sum recorded
- Color-coded dice with random gradients per roll for visual contrast
- Works offline once loaded — no network call per roll
- Mobile-friendly tap targets
- Suitable for D&D, Pathfinder, board games, statistics demos and house rules
Free. No signup. Your inputs stay in your browser. Ads via Google AdSense (consent required).
Frequently asked questions
Are these dice actually fair — every face equally likely?
Yes. Each face value is generated by `crypto.getRandomValues()` (W3C Web Cryptography API Recommendation 26 January 2017) and uses rejection sampling so every face has exactly equal probability. The d100 case is the strict test: 100 does not divide 2³² evenly, so naive `r % 100` would give the lower 96 faces about 1 in 4.3 billion more probability than faces 97..100 per roll. Rejection sampling fixes this — the rare retry adds negligible cost (expected fewer than 2 retries per roll regardless of die size). For real wooden dice the story is different: Pearson and Weldon's 1900 dataset (26,306 throws of 12 dice) detected a small but statistically significant bias toward 5 and 6 in the wooden dice of the era because pip carvings remove material from those faces. Modern injection-moulded dice are much closer to fair, but the SVG dice on this page are mathematically exactly fair.
Why d100 — that is not a real polyhedron, is it?
Correct: there is no convex regular polyhedron with 100 faces. The Platonic solids stop at the icosahedron (20 faces); the next regular shape that admits a fair die is the disdyakis triacontahedron (120 faces). In practice d100 is implemented as two d10s (a percentile die plus a unit die), or as a single Zocchihedron (a 100-sided geometric novelty introduced by Lou Zocchi in 1985, mechanically a sphere with 100 flattened faces — not truly fair because its surface has subtle topological constraints). This tool's d100 is purely numerical: it picks 1..100 uniformly using `crypto.getRandomValues()` plus rejection sampling, and renders the result inside the same SVG silhouette as the d10 (a pentagonal trapezohedron) because that is the conventional visual shorthand for "percentile die" in tabletop RPG layouts.
Why does the d20 not look like the icosahedron from my D&D set?
An icosahedron has 20 triangular faces in 3D; on a 2D screen we have to project it. This tool draws a decagonal silhouette (10-sided polygon outline) because the icosahedron's typical visible profile from a tabletop viewing angle is roughly a decagon — the same convention used by online D&D character sheets. The number rendered inside is the rolled face value (1..20). The d4 is rendered as a triangle (tetrahedron projects to triangle), d8 as a square rotated 45° (octahedron's profile at orthographic view is a square diamond), d12 as a hexagon (dodecahedron's profile is hexagonal). The geometric correspondence is approximate by necessity; what matters for the game is the number, which is generated fairly per the previous answer.
Should I trust this for D&D, Pathfinder, or tournament play?
For home games and online tabletop sessions, yes — the entropy source (`crypto.getRandomValues()`) is cryptographically secure and the rejection-sampling logic is mathematically exact, which is a property physical dice cannot match (Pearson and Weldon 1900 measured the residual bias in pre-injection-mould wooden dice). For sanctioned tournament play with prize money, organizers typically require physical dice with a defined drop height and a witness — that is procedural fairness, not statistical, and no client-side tool can substitute. For statistics homework demonstrating dice probability (the sum-of-two-dice distribution, modal outcome at 7 for 2d6, the chi-square test against an observed empirical distribution per Pearson 1900), the tool produces clean exact data. The roll history is preserved in the session for audit and re-running a sequence.
How likely is a critical hit (natural 20 on d20) per the underlying math?
Exactly 1 in 20 = 5 % per roll, because the d20 here is uniform on 1..20. "Advantage" (roll twice, take the higher) raises the probability of a natural 20 to 1 − (19/20)² = 1 − 361/400 = 9.75 %; "disadvantage" lowers it to (1/20)² = 0.25 %. These are the same values D&D 5e tabletop play uses; D&D's published probabilities match the math of a uniform d20 exactly (no house-favoring fudge). For two-dice sums (2d6): the modal sum is 7 with probability 6/36 = 16.7 %; sums 2 and 12 are tied for least likely at 1/36 = 2.78 %. Sum distributions for nd6 (n ≥ 3) approach a discrete bell curve per the Central Limit Theorem, centered at 3.5n with variance n × 35/12.
Sources (6)
- World Wide Web Consortium (W3C) (2017). Web Cryptography API — each die face is generated by `crypto.getRandomValues()` plus rejection sampling, which makes every face equally likely even for d100 (where the underlying 2^32 range is not divisible by 100 and naive `r % 100` would skew probabilities toward the lower 96 faces by about 1 in 4.3 billion per draw); same secure entropy used by password managers and TLS handshakes. W3C Recommendation 26 January 2017 (Crypto.getRandomValues §3.3).
- Knuth, D. E. (1997). The Art of Computer Programming, Volume 2: Seminumerical Algorithms — Chapter 3 "Random Numbers" — establishes the proof that rejection sampling on a uniform source produces an unbiased uniform output for any integer bound, and analyses the expected number of retries (bounded by 2 retries for any bound up to 2^31); also covers the dice-sum distribution (the sum of n d-sided dice approaches a discrete Gaussian centred at n·(d+1)/2 as n grows). Addison-Wesley, 3rd edition (1997, ISBN 0-201-89684-2); Ch. 3 dates from 1st edition 1969.
- Pearson, K., & Weldon, W. F. R. (1900). Dice-tossing dataset of 26,306 throws of 12 dice — Weldon collected the data (each throw he counted dice showing 5 or 6 as a "success"), Pearson analysed it with the newly-introduced chi-square test; the dataset showed a small but statistically significant bias toward 5 and 6 in the wooden dice of the era, which Pearson interpreted as physical asymmetry around the carved pips; modern injection-moulded dice and SVG-rendered virtual dice are not affected by this bias. Pearson 1900 Philosophical Magazine Series 5 Vol. 50 No. 302 pp. 157–175; Weldon's raw data later published in Labby 2009 ("Weldon's dice, automated" Chance vol. 22 no. 4) with modern statistical re-analysis.
- Ecma International (2024). ECMA-262 16th edition (ECMAScript 2025) — `Math.random()` returns a Number in [0, 1) generated by an implementation-defined PRNG; V8 (Chrome, Node.js, Edge, Opera) and SpiderMonkey (Firefox) both implement xorshift128+ (Vigna 2014); V8 switched to xorshift128+ in v4.9.41, shipped with Chrome 49 stable in March 2016, replacing the earlier MWC1616 algorithm; xorshift128+ has a period of 2^128 − 1 and passes the BigCrush battery of TestU01 but is NOT cryptographically secure and SHOULD NOT be used for game integrity or fair tournament draws — this tool uses `crypto.getRandomValues()` instead. Ecma International, June 2025 (16th edition / ECMAScript 2025; PDF filename ECMA-262_16th_edition_june_2025.pdf at ecma-international.org); §21.3.2.27 Math.random; V8 implementation history at v8.dev/blog/math-random.
- Vigna, S. (2014). Further scramblings of Marsaglia's xorshift generators — defines xorshift128+, the algorithm V8 (Chrome, Node.js, Edge, Opera) and SpiderMonkey (Firefox) use as the implementation of `Math.random()`; replaces the older MWC1616 that V8 used pre-v4.9.41. Journal of Computational and Applied Mathematics 315 (May 2017) pp 175-181; pre-print arXiv:1404.0390 (April 2014, last revised 2016).
- World Wide Web Consortium (W3C) (2018). Web Content Accessibility Guidelines (WCAG) 2.1 — Success Criterion 4.1.3 Status Messages — the rolled dice values + live sum update via `aria-live="polite"` regions so screen-reader users hear each outcome without focus loss; the polyhedron shapes are decorative (aria-hidden) and the textual roll result carries the semantic meaning. W3C Recommendation 5 June 2018; carried unchanged into WCAG 2.2 (Recommendation 5 October 2023).
These are the original publications the formulas in this tool are based on. Locate them by journal name and year on Google Scholar or PubMed.
By Marco B. ·