Skip to content
math

Uniform Distribution Calculator

Compute mean, variance, density, and cumulative probability for a continuous uniform distribution on [a, b].

Mean
5
Variance
8.3333
Density f(x)
0.1
P(X ≤ x)
0.2

How it works

  1. 1Enter the lower bound a and upper bound b to define [a, b]. Every point is equally likely, giving a flat density of 1 ÷ (b − a).
  2. 2Enter a value x to evaluate the CDF. P(X ≤ x) is 0 for x ≤ a, 1 for x ≥ b, and (x − a) ÷ (b − a) in between.
  3. 3The calculator shows the mean (a + b) ÷ 2, variance (b − a)² ÷ 12, standard deviation, density f(x), and P(X ≤ x).

Use cases

  • Modelling a random arrival time equally likely anywhere within a fixed window, like a bus between two scheduled times.
  • Generating random numbers with a known range in simulations — the uniform is the basis of most pseudorandom generators.
  • Quality control where a measurement error is bounded and equally likely across its range.

Frequently asked questions

What does the density f(x) = 1 ÷ (b − a) mean?

Because every outcome in [a, b] is equally likely, probability is spread evenly. The density is the same constant everywhere inside [a, b] and 0 outside. Multiply it by a sub-interval length to get that interval’s probability.

Why is the mean exactly halfway between a and b?

By symmetry the uniform distribution has no skew, so its expected value is the midpoint (a + b) ÷ 2. You can verify it by integrating x · f(x) from a to b.

What happens when x is outside [a, b]?

P(X ≤ x) is clamped to 0 when x ≤ a (impossible) and to 1 when x ≥ b (certain). The density describes the distribution shape, not a probability at a single point.

See all →