Uniform Distribution Calculator

The continuous uniform distribution spreads probability evenly across an interval from a to b. Enter the lower bound, the upper bound, and a point x. The calculator returns the probability density at x, the cumulative probability that a draw is at most x, and the distribution's mean and variance. Every value inside the range is equally likely, which makes this distribution the natural model for rounding errors, the output of a basic random number generator, and any quantity known only to lie within fixed limits. All four outputs come from exact closed-form expressions.

0.00
0.00
0.00
0.00

Uniform distribution formulas

f(x) = 1 / (b - a) for a <= x <= b, else 0
F(x) = 0 for x < a; (x - a) / (b - a) for a <= x <= b; 1 for x > b
Mean = (a + b) / 2
Variance = (b - a)^2 / 12

The density is a flat constant over the interval, so its height is the reciprocal of the width. The cumulative function rises linearly from 0 at a to 1 at b.

Worked example and notes

  • On [0, 10] the density is 1/10 = 0.10 everywhere inside the interval.
  • At x = 4 the cumulative probability is (4 - 0)/10 = 0.40.
  • The mean is the midpoint (0 + 10)/2 = 5.
  • The variance is 10^2 / 12 = 8.33, giving a standard deviation of about 2.89.
  • For x outside [a, b], density is 0 and the cumulative value is 0 or 1.

Uniform distribution: frequently asked questions

What is the continuous uniform distribution?

The continuous uniform distribution on the interval from a to b assigns equal probability density to every point in that interval and zero outside it. It models a quantity that is equally likely to fall anywhere in a known range, such as rounding error or a randomly chosen point on a line segment.

What is the density at a point x?

Inside the interval [a, b] the probability density is the constant 1 divided by (b minus a). Outside the interval the density is 0. The density is the same everywhere inside the range, which is what makes the distribution uniform.

How is the cumulative probability defined?

The cumulative distribution function F(x) is 0 for x below a, equals (x minus a) divided by (b minus a) for x between a and b, and equals 1 for x at or above b. It gives the probability that a draw is at most x.

What are the mean and variance?

The mean is (a plus b) divided by 2, the midpoint of the interval. The variance is (b minus a) squared divided by 12, so the standard deviation is the range divided by the square root of 12, about 0.2887 times the range.

What are valid inputs?

The lower bound a must be strictly less than the upper bound b. The evaluation point x can be any real number; the calculator returns the correct density and cumulative value even when x lies outside the interval.

Official sources

Reviewed by the CalculatorHub team, edited by James Graham, 16 June 2026. See our methodology.