Random Dice Roll Generator (D4)

 
Generated using the Web Crypto API for cryptographically secure randomness.

About the D4

The four-sided die (D4) is shaped like a triangular pyramid and is a standard die in tabletop role-playing games. It produces numbers from 1 to 4 with equal probability and is commonly used for small damage rolls, healing effects, and simple random choices.

This digital version uses the Web Crypto API to produce cryptographically secure random numbers, ensuring a uniform distribution with no physical bias.

Probability

P(x) = 1/4 = 25%

The expected value of a single D4 roll is 2.5. Each of the four faces has an exactly equal 25% probability of landing face up.

Use cases

  • D&D weapon damage for daggers, clubs, and improvised hits
  • Small healing or damage effects in tabletop RPGs
  • Quick selection from up to 4 options
  • Simple probability exercises with four outcomes

How it works

  1. Your browser generates a cryptographically secure 32-bit unsigned integer
  2. The integer is mapped to the range 1-4 using modular arithmetic
  3. The result is displayed instantly with no server request needed
  4. Roll history and stats are tracked locally in your browser session

Privacy and security

Your dice rolls never leave your device. This tool runs entirely in your browser using client-side JavaScript, with no generator API calls, server-side generation, or storage of generated values.