Uniform Distribution Calculator

Continuous uniform distribution on [a, b]: P(X < x), P(X > x) and P(c < X < d), plus the mean, median, variance and standard deviation.

The smallest possible value.
The largest possible value. Must be greater than a.
If d is smaller than c the two are swapped.

Results

P(X < 12)
0.521739
P(X > 12)
0.478261
P(2 < X < 18)
0.695652
Mean and median ((a + b) ÷ 2)
11.5
Standard deviation ((b − a) ÷ √12)
6.6395
Variance ((b − a)² ÷ 12)
44.0833
Height of the density, 1 ÷ (b − a)
0.043478

How it’s calculated

A continuous uniform distribution says every value between a minimum a and a maximum b is equally likely, so the probability of landing in an interval is simply its length as a fraction of the whole range. It models things like a random wait that can be anywhere between two times, or a random number between a and b.

density f(x) = 1 ÷ (b − a) for a ≤ x ≤ b P(X < x) = (x − a) ÷ (b − a) P(c < X < d) = (d − c) ÷ (b − a) (clipped to [a, b]) mean = (a + b) ÷ 2, standard deviation = (b − a) ÷ √12

Worked example (OpenStax §5.2, baby smiling times): X is uniform from a = 0 to b = 23 seconds. The mean is 23 ÷ 2 = 11.5 seconds and the standard deviation is 23 ÷ √12 = 6.64 seconds. The probability that a smile lasts between 2 and 18 seconds is (18 − 2) ÷ 23 = 0.6957.

Values of x outside [a, b] are handled for you: below a the cumulative probability is 0, above b it is 1.

Frequently asked questions

Why is P(X = x) zero?

For a continuous distribution the probability is spread over an interval, so any single exact value has probability zero. That is why P(X < x) and P(X ≤ x) are equal.

Is this the same as a discrete uniform distribution?

No. This page handles any real value between a and b. For a fair die with whole-number outcomes, use the dice probability calculator.

How do I get a conditional probability, such as P(X > 18 given X > 12)?

Because the distribution is uniform, restrict to the new range: the answer is (b − 18) ÷ (b − 12). With b = 23 that is 5 ÷ 11 = 0.4545.

What if x is outside the range?

The calculator clips it. P(X < x) is 0 when x ≤ a and 1 when x ≥ b.

Embed this calculator

Add this free calculator to your own website. Copy the code below into your page’s HTML:

Need this calculator branded, changed or built around your own prices?See custom business solutions →

Sources

Formulas are taken from the free public references above. Results are provided “as is” for informational and educational purposes only. See our disclaimer.

Added · Last updated · How we check our calculators

Spotted a mistake or missing option? Report a problem· Suggest a calculator