Uniform Distribution Calculator

Written by Thierno Sadou Diallo, formula verified per our methodology • Last checked on 9/10/2026

For a variable uniform on [a, b], P(c < X < d) = (d − c) ÷ (b − a). For X uniform on [0, 10], the probability that X is between 2 and 6 is 0.4 (40%), for an expected value of 5 and a standard deviation of about 2.89.

Explanation

The continuous uniform distribution describes a random variable whose every value in an interval [a, b] is equally likely, with no zone of the interval favored — it is the simplest continuous probability distribution to understand, often used as a first example in statistics, but also as a realistic model for phenomena that are genuinely equiprobable over an interval (a random number generator, an arrival time uniformly distributed over a time window). The probability that a value falls in a sub-interval [c, d] is calculated simply by a ratio of lengths: (d − c), the length of the sought sub-interval, divided by (b − a), the total length of the interval — the larger the sub-interval relative to the total interval, the higher the probability, independent of its position. The expected value (the average expected value) is always exactly at the middle of the interval, (a + b) ÷ 2, by symmetry. The standard deviation, which measures the dispersion of the values, is (b − a) ÷ √12, a formula that follows from the variance calculation of this distribution. The uniform distribution complements the other probability distributions already covered on this site: our exponential distribution calculator for a waiting time, or our binomial distribution calculator for a number of successes over repeated trials — each suited to a different type of random phenomenon.

Example: X uniform on [0, 10], probability that X is between 2 and 6

Inputs

Interval: [0, 10]. Sought sub-interval: [2, 6].

Calculation

P(2 < X < 6) = (6 − 2) ÷ (10 − 0) = 4 ÷ 10 = 0.4. Expected value = (0 + 10) ÷ 2 = 5. Standard deviation = (10 − 0) ÷ √12 ≈ 2.887.

Result

The probability that X is between 2 and 6 is 40%, for an average of 5.

Frequently asked questions

Why does the probability depend only on the length of the sub-interval, not its position?

Because that is the very definition of the uniform distribution: every point of the interval [a, b] has exactly the same probability density. Two sub-intervals of the same length, wherever they are in [a, b], therefore always have exactly the same probability — it is this property that distinguishes the uniform distribution from most other continuous distributions, such as the normal distribution, where the probability depends strongly on the position relative to the mean.

What happens if the sought sub-interval extends beyond the bounds a and b?

This calculator assumes the sub-interval [c, d] is entirely contained in [a, b]. If part of [c, d] extends beyond the bounds of the total interval, the formula would give a result greater than 1 (a probability above 100%, which makes no sense): in that case, you must first clip c and d to the real bounds of the interval before calculating.

In what real cases does the uniform distribution apply?

It models well situations that are genuinely equiprobable over a continuous interval: a random stopping point of a lottery wheel, the exact arrival time of a bus assumed uniformly distributed over its scheduled window, or the number produced by a standard pseudo-random number generator, designed precisely to follow a uniform distribution on [0, 1].

Related resources

Similar calculators