About 123DiceRoller

123DiceRoller is a free online dice roller that throws realistic 3D dice in your browser. It is built to be fair, fast and private: results come from a cryptographically secure random generator, the dice are thrown with real physics, and nothing about you or your rolls is sent to a server.

How a roll works, step by step

  1. The numbers are drawn first. For each die, your browser's Web Crypto API (crypto.getRandomValues) supplies a random 32-bit number. It is reduced to a face with rejection sampling — draws that would make low faces very slightly more likely are thrown away — so every face of an N-sided die has exactly a 1-in-N chance.
  2. The throw is simulated. A rigid-body physics engine (cannon-es) throws the dice onto the table with gravity, friction, bounce and collisions between dice. The whole throw is computed in a fraction of a second before it is shown.
  3. The dice are turned to match. Every die shape is symmetrical: a d20 can be rotated 60 different ways and look identical. The roller picks the one rotation that brings the drawn number to where the physics put the top face, and applies it from the very first frame. The motion is genuine; the number was already decided, fairly.
  4. Cocked dice are re-thrown. If any die would come to rest leaning on another, the throw is redone invisibly, as a real table would call for a re-roll.
  5. The throw is played back with shadows, reflections and sound timed to each impact.

Why not let the physics pick the number?

Because a simulation is not a fair random source. Small details of the starting position, the time step and rounding make some faces come up more often than others, and nobody can prove they do not. A cryptographic generator is designed and tested to be unpredictable and uniform. Separating the two gives you the best of both: a throw that looks and sounds real, and a result you can trust.

Exact probabilities

The odds shown for every roll are calculated, not guessed. Sums are computed by convolution, one die at a time, and keep-or-drop rolls such as advantage by counting every distinct outcome. The dice probability calculator explains the method.

Built on

  • three.js for the 3D rendering (MIT licence)
  • cannon-es for the physics (MIT licence)
  • Plain PHP on the server, with no database, no accounts and no tracking

Both libraries are served from this site rather than a third-party CDN, so the page never loads code from anywhere else.

Part of the 123 family

123DiceRoller sits alongside 123Calculator and our other free, no-sign-up tools. Questions, ideas or a bug to report? Email hello@123diceroller.com.

Last updated