Virtual Dice
Roll a virtual dice with 4, 6, 8, 10, 12 or 20 sides directly in the browser.
How to use?
Escolha o tipo de dado (D4 a D20) e clique em Roll. O resultado aparece imediatamente com o histórico das últimas rodadas.
A history of dice: from Sumerian astragali (3000 BCE) to the modern d20
The die is arguably humanity's oldest randomizing instrument. Before six-sided cubes existed, ancient peoples used astragali, the ankle bones of sheep and goats, which when tossed landed in four naturally stable positions. The British Museum holds astragali dated to roughly 5,000 BCE, and the practice of astragalomancy (divination by knucklebone) is documented from Cyprus and Greece to Mesopotamia and Egypt.
Around 3000 BCE, the Sumerians began shaving astragali to make them more cubic, and soon dice of ivory, bone, and stone with carved pips appeared across the Near East. The Royal Game of Ur, excavated by Leonard Woolley in the 1920s, used tetrahedral four-sided dice — a polyhedral concept that anticipated modern role-playing dice by millennia. In Egypt, cubic dice of ivory and faience were used in Senet, a board game that served as both entertainment and religious metaphor for the soul's journey through the afterlife.
Rome distinguished tesserae (six-sided cubic dice) from tali (astragali), and dicing pervaded every social class — Augustus regularly lost large sums and Claudius wrote a treatise on the game. Roman dice from Pompeii frequently show tampering: asymmetric cubes, lead-weighted interiors, and pips drilled to uneven depths to favor specific faces.
Medieval church councils condemned dicing from the 4th century onward, yet the practice persisted. By 1254, Paris had a guild of dice-makers with strict rules on materials. The Arabic game az-zahr ("the die") arrived with returning crusaders and evolved into medieval Hazard, the direct ancestor of modern Craps as simplified by Bernard de Marigny in New Orleans around 1813. The 20th century brought polyhedral dice into mainstream use: Gary Gygax and Dave Arneson popularized the d4–d20 set with the first edition of Dungeons & Dragons in 1974, and NdX notation became universal vocabulary among tabletop and video game communities.
Geometry of dice: Platonic solids (tetrahedron, cube, octahedron, dodecahedron, icosahedron)
For a die to be mathematically fair, every face must have the same probability of landing face up — which requires symmetry. The only five convex polyhedra with identical faces, identical vertices, and identical edges are the Platonic solids, described by Plato in the Timaeus (~360 BCE) and proved to be the only possibilities by Euclid in the Elements:
- Tetrahedron (d4) — 4 triangular faces; the oldest die with polyhedral form.
- Cube / hexahedron (d6) — 6 square faces; the everyday die used in nearly every classic game.
- Octahedron (d8) — 8 triangular faces; common in RPGs for medium-weapon damage.
- Dodecahedron (d12) — 12 pentagonal faces; rare but used for months, zodiac signs, and heavy damage.
- Icosahedron (d20) — 20 triangular faces; the emblem of D&D and of "roll-against-difficulty" systems.
The d10 is not Platonic — it is a pentagonal trapezohedron (ten kite-shaped faces), invented in the 1980s to generate digits 0–9 and simulate percentile rolls (two d10s = 1–100). There are also isohedral non-Platonic shapes that remain mathematically fair without being Platonic solids.
Physical balance: manufacturing tolerance, casino precision dice
A typical injection-molded plastic die from a party-supply store can have mass deviations of several tenths of a millimeter between faces — invisible to the eye, but enough to skew statistical tests over 100,000 rolls. That is why regulated casinos use precision dice (also called casino dice), manufactured to industrial-metrology tolerances.
- Dimensions: 19.05 mm (0.75 inch) per edge, with a tolerance of ±0.0005 inch (~0.013 mm) recognized by the Nevada Gaming Control Board.
- Material: solid block of transparent cellulose acetate, so internal tampering is visible under light.
- Edges: razor-sharp rather than rounded, which reduces the "rolling-stop bias" of one face being preferred.
- Pips: drilled to uniform depth and back-filled with material of the same density as the body, so the center of mass stays at the geometric center.
- Serialization: each die has an engraved serial number; casinos retire them after only a few hours of play.
To audit fairness, labs measure each die with a micrometer, run a float test (the die floats in dense saline — if it always rotates to the same face, it is unbalanced), and perform chi-square tests on thousands of rolls. A common bar die fails these tests rapidly; a Vegas-regulation die does not.
Randomness in apps: PRNG (Mersenne Twister) vs CSPRNG (crypto.getRandomValues)
A virtual die has no geometry — its fairness depends on the browser's pseudo-random number generator (PRNG). JavaScript's Math.random() returns a uniform float in [0, 1). For an N-sided die: Math.floor(Math.random() * N) + 1.
- Algorithm: V8 uses xorshift128+; other engines use Mersenne Twister. All have huge periods but are deterministic.
- No seeding: for reproducibility, libraries like
random-jsoffer a seedable Mersenne Twister 19937. - CSPRNG: for serious draws, use
crypto.getRandomValues(), which queries the OS entropy source. - Modulo bias:
n % 6over aUint32introduces a tiny bias. The correct fix is rejection sampling.
For recreational use, Math.random() is more than adequate — the statistical difference is undetectable over hundreds of rolls. For formal audits, prefer the Web Crypto API.
Applications: RPG, board games, teaching probability, raffles
- Tabletop RPGs — D&D, Pathfinder, Call of Cthulhu, Shadowrun all require d4–d20.
- Board games — Monopoly, Catan, Risk, Yahtzee, Backgammon use d6 in pairs.
- Education — teachers demonstrate uniform distribution and the law of large numbers.
- Raffles and decisions — pick who pays the bill, decide order, settle disputes impartially.
- Creativity — character generators, word games, creative writing prompts.
Trivia: the 100-sided die (Zocchihedron), non-transitive dice
The Zocchihedron, created by Lou Zocchi in the 1980s, is a 100-faceted spheroidal "die" with an internal plastic ballast that brakes its rolling — it is not a true uniform polyhedron, and its fairness is debated among purists. Non-transitive dice (such as Efron's dice) defy intuition: die A beats die B more often than not, B beats C, C beats D — and D beats A. It is the probabilistic equivalent of rock-paper-scissors and is mathematically impossible with conventional dice. Another curiosity is the Sicherman dice: a pair with faces (1,2,2,3,3,4) and (1,3,4,5,6,8) produces exactly the same sum distribution as a pair of standard d6 (2–12, with 7 as the most likely sum).
FAQ
Is the virtual die really fair?
For casual use, yes. It uses the browser's Math.random(), which has statistically uniform distribution. For official draws with financial value, use tools backed by CSPRNG and auditable logs.
Why no D100?
The interface offers d4 through d20, enough for 99% of games. For percentiles, roll two d10s (or one d100 mentally: tens × 10 + units).
Can I use it to draw prizes?
For informal gatherings and fun, yes. Promotions with formal regulations (local lottery boards) require generators that meet specific audit standards.
Why does the history show only the latest results?
To avoid visual clutter. If you need to record many rolls, copy the history before closing the tab — it is not persisted across reloads.
Can I roll multiple dice at once?
The current widget rolls one die at a time. For multiple quick rolls, click repeatedly — the history preserves the sequence.
Roll virtual dice of any size
Lost the die from your board game or need a d20 for the RPG session? This virtual die rolls right in the browser and goes beyond the classic six sides. You choose between 4, 6, 8, 10, 12 or 20 faces depending on what the game calls for.
It's a lifesaver for tabletop RPG players, for people who love board games or anyone who just needs a random number within a fixed range. Each roll is fair, with equal odds for every face, using the device's own randomness.
No app and no sign-up. The roll is immediate and works offline once the page loads. Roll as many times as you need, switching the number of faces whenever you like.