Uniform Distribution Calculator

When Every Outcome in a Range Is Equally Likely

Not every distribution has a peak or a most-likely value. The uniform distribution describes situations where every outcome in a defined range is exactly as likely as every other — a random number generator producing decimals between 0 and 1, or a fair die where each face is equally probable. This calculator covers both the continuous version (any value in a range) and the discrete version (whole numbers only).

The Formulas

Continuous, on [a, b]:
Mean = (a+b) ÷ 2   Variance = (b−a)² ÷ 12   PDF f(x) = 1 ÷ (b−a)

Discrete, on integers [a, b] with n = b−a+1:
Mean = (a+b) ÷ 2   Variance = (n²−1) ÷ 12   PMF = 1 ÷ n

Worked Examples

Continuous uniform on [0, 10] vs. discrete uniform on {1..6} (a fair die)
TypeMeanVarianceStd Dev
Continuous [0, 10]5.08.3332.887
Discrete {1, 2, 3, 4, 5, 6}3.52.9171.708

For the continuous example, P(3 ≤ X ≤ 7) = (7−3) ÷ (10−0) = 0.40 exactly — probability in a continuous uniform distribution is just the proportion of the interval covered.

Where This Matters

  • Random number generation — most pseudo-random number generators produce a continuous uniform distribution as their base output, which is then transformed into other distributions.
  • Simulation and Monte Carlo methods — uniform sampling is the starting point for simulating countless other probability distributions.
  • Scheduling problems — modeling an arrival or event time as uniformly likely across a known window.
  • Fair games of chance — a single die roll or spin of an unweighted wheel is a discrete uniform distribution by design.

How to Use This Calculator

  1. Choose Continuous Uniform Distribution or Discrete Uniform Distribution from the dropdown.
  2. Enter the lower bound (a) and upper bound (b) of the distribution.
  3. Enter the range (x1 to x2) you want the probability for.
  4. Select Calculate to get the probability, along with the distribution's mean, variance, and standard deviation.

Related Calculations

For non-uniform outcomes like dice sums, use the Dice Roll Calculator. For the continuous waiting-time analog, see the Exponential Distribution Calculator.