Uniform Distribution Calculator

Find probabilities, mean, variance, and standard deviation for any continuous uniform distribution U(a, b).

📊 Uniform Distribution Calculator
Lower bound a
050
Upper bound b
1100
Lower query limit x₁
050
Upper query limit x₂
050
Lower bound a
050
Upper bound b
1100
P(x₁ ≤ X ≤ x₂)
P(X ≤ x₂)
P(X ≥ x₁)
Mean
Variance
Std Dev
Mean
Median
Variance
Std Dev
IQR
PDF f(x)
Range
Skewness
Kurtosis

📊 What is the Uniform Distribution Calculator?

The continuous uniform distribution U(a, b) is a probability model in which every value in the interval [a, b] is equally likely. The probability of landing in any sub-interval is directly proportional to the length of that sub-interval, divided by the total width of the distribution. This simplicity makes the uniform distribution one of the most important building blocks in probability and statistics.

This calculator handles two common tasks. In Probability mode, you enter the distribution bounds (a and b) plus the query limits (x1 and x2), and the calculator returns P(x1 to x2), P(X below x2), and P(X above x1). In Distribution Stats mode, you enter only a and b to see the full parameter set: mean, median, variance, standard deviation, interquartile range, PDF height, range, skewness, and kurtosis.

Real-world applications of the uniform distribution are wide-ranging. In transportation, a bus that arrives at random within a 20-minute window follows U(0, 20). In computing, pseudorandom number generators produce U(0, 1) values that seed simulations and cryptographic functions. In manufacturing and metrology, rounding errors in analog-to-digital conversion are well modeled by U(-0.5, 0.5). In Monte Carlo simulation, uniform draws are transformed into any desired distribution via the inverse-CDF method. In statistics education, the uniform distribution demonstrates core concepts such as CDF, PDF, and percentiles in the simplest possible setting before students tackle the normal or exponential distributions.

A common misconception is that "uniform" means all outcomes are equally probable in the discrete sense. For the continuous uniform distribution, individual point probabilities are zero. Only intervals have positive probability. This is why the PDF height 1/(b-a) is a density, not a direct probability. Another distinction worth noting: this calculator covers the continuous case. The discrete uniform distribution, where X takes only integer values from a to b, uses slightly different formulas, particularly for variance.

📐 Formulas

PDF: f(x) = 1 ÷ (b − a)  for a ≤ x ≤ b
a = lower bound of the distribution
b = upper bound of the distribution
f(x) = probability density at point x (constant over [a, b])
P(x₁ ≤ X ≤ x₂) = (x₂ − x₁) ÷ (b − a)
x₁ = lower query limit (must be in [a, b])
x₂ = upper query limit (must be in [a, b])
Example: U(0, 10), query [3, 7]: P = (7-3)/10 = 4/10 = 40%
Mean = (a + b) ÷ 2
Variance = (b − a)² ÷ 12
Std Dev = (b − a) ÷ √12
IQR = (b − a) ÷ 2
Skewness = 0 (perfectly symmetric)
Kurtosis = −1.2 (excess kurtosis, platykurtic)
Example: U(0, 10): Mean = 5, Variance = 100/12 ≈ 8.333, SD ≈ 2.887

📖 How to Use This Calculator

Steps

1
Enter distribution bounds - Type the lower bound a and upper bound b. Any real values work as long as b is strictly greater than a. Use the sliders for quick adjustments or type precise decimals directly.
2
Choose a mode - Click "Probability" to compute P(x1 to x2), P(X below x2), and P(X above x1). Click "Distribution Stats" to get all parameters including mean, variance, SD, IQR, PDF height, skewness, and kurtosis.
3
Enter query limits and read results - In Probability mode, type x1 and x2. Results update instantly. Query limits outside [a, b] are automatically clamped so you can compute cumulative probabilities like P(X below 5) by setting x1 = a.

💡 Example Calculations

Example 1 - Bus Arrival Time

A city bus arrives uniformly at random between 0 and 10 minutes. What is the probability of waiting between 2 and 5 minutes?

1
Set a = 0, b = 10. The bus arrival follows U(0, 10).
2
Set x1 = 2 and x2 = 5. Apply P(x1 to x2) = (x2 - x1) / (b - a) = (5 - 2) / (10 - 0) = 3 / 10 = 30%.
3
P(waiting more than 7 minutes) = (10 - 7) / 10 = 30%. Mean wait = (0 + 10) / 2 = 5 minutes.
P(2 ≤ X ≤ 5) = 30%
Try this example →

Example 2 - Standard Uniform U(0, 1)

A standard uniform random number U(0, 1) is generated. What is the probability it falls below 0.75? What are the mean and variance?

1
Set a = 0, b = 1. This is the standard uniform distribution, the basis for most random number generators.
2
P(X below 0.75) = (0.75 - 0) / (1 - 0) = 0.75 = 75%. This is simply the CDF evaluated at x = 0.75.
3
Mean = (0 + 1) / 2 = 0.5. Variance = (1 - 0)^2 / 12 = 1/12 ≈ 0.0833. SD = 1 / sqrt(12) ≈ 0.2887.
P(X ≤ 0.75) = 75%, Mean = 0.5, SD ≈ 0.2887
Try this example →

Example 3 - Manufacturing Measurement Error

A sensor reading has a uniform measurement error on [-0.5, 0.5] mm. Find the variance, SD, and probability the error exceeds 0.3 mm in magnitude.

1
Set a = -0.5, b = 0.5. The range is b - a = 1 mm. The PDF height is 1 / 1 = 1.
2
Variance = (0.5 - (-0.5))^2 / 12 = 1 / 12 ≈ 0.0833 mm^2. SD = 1 / sqrt(12) ≈ 0.2887 mm.
3
P(|error| more than 0.3) = P(X below -0.3) + P(X above 0.3) = 0.2/1 + 0.2/1 = 40%.
Variance ≈ 0.0833, SD ≈ 0.2887 mm, P(|error| > 0.3) = 40%
Try this example →

❓ Frequently Asked Questions

What is a continuous uniform distribution?+
A continuous uniform distribution U(a, b) assigns equal probability density to every point in the interval [a, b] and zero density outside it. The PDF is a flat rectangle of height 1/(b-a) over the interval. Individual points have zero probability; only intervals have positive probability equal to their length divided by (b-a).
What is the PDF formula for U(a, b)?+
f(x) = 1 / (b - a) for a less than or equal to x and x less than or equal to b, and 0 elsewhere. The height 1/(b-a) ensures the total area under the PDF equals 1. For U(0, 10) the PDF is 0.1; for U(0, 1) it is 1; for U(5, 15) it is 0.1.
How do I compute P(x1 to x2) for a uniform distribution?+
P(x1 less than or equal to X less than or equal to x2) = (x2 - x1) / (b - a), after clamping x1 and x2 to [a, b]. For U(0, 20) and the query [4, 12]: P = (12 - 4) / 20 = 40%. This works because probability equals area under the PDF, and the PDF is constant.
What is the mean of the uniform distribution U(a, b)?+
The mean is (a + b) / 2, the midpoint of the interval. For U(2, 8) the mean is 5. For U(-3, 3) the mean is 0. The mean and median are identical because the uniform distribution is symmetric about its center.
What is the variance of a uniform distribution?+
The variance is (b - a)^2 / 12. For U(0, 1) this is 1/12 ≈ 0.0833. For U(0, 12) it is 144/12 = 12. The denominator 12 comes from the integral of (x - mean)^2 times the PDF 1/(b-a) over the interval, which simplifies to (b-a)^2 / 12.
What is the standard deviation of U(a, b)?+
The SD is (b - a) / sqrt(12), equivalent to (b - a) / (2 * sqrt(3)). For U(0, 1) this is approximately 0.2887. For U(0, 10) it is about 2.887. Doubling the interval width doubles the SD, since SD scales linearly with the range.
What is the interquartile range (IQR) of U(a, b)?+
The IQR is (b - a) / 2. The 25th percentile (Q1) is a + (b-a)/4 and the 75th percentile (Q3) is a + 3(b-a)/4. Their difference is (b-a)/2. For U(0, 10) the IQR is 5, Q1 = 2.5, Q3 = 7.5.
Is the uniform distribution symmetric? What is its skewness?+
Yes, the uniform distribution is perfectly symmetric about its mean (a+b)/2. Its skewness is exactly 0. There is no preference for values to the left or right of the mean, and both tails (if you can call them that) have identical weight. This makes it a natural starting point for studying symmetry in distributions.
What does kurtosis = -1.2 mean for a uniform distribution?+
The excess kurtosis of -1.2 means the uniform distribution is platykurtic: flatter and lighter-tailed than the normal distribution (which has excess kurtosis 0). There are no heavy tails or extreme outliers, because probability mass is spread evenly over the interval and drops to zero abruptly at the boundaries.
When is the uniform distribution used in real life?+
The uniform distribution appears in random number generation (the basis for all simulation), modeling arrival times when no time is preferred over another, rounding errors in quantization, Bayesian priors when no prior information favors any value in a range, and Monte Carlo methods where uniform samples are transformed via the inverse-CDF into any target distribution.
What is the CDF of U(a, b)?+
The cumulative distribution function is F(x) = 0 for x below a, (x - a) / (b - a) for a less than or equal to x less than or equal to b, and 1 for x above b. It is a straight line rising from 0 to 1 over the interval [a, b]. P(X less than or equal to x) is simply how far x is from a, as a proportion of the total width.
How does U(0, 1) relate to other distributions?+
U(0, 1) is the foundational distribution in simulation. If U follows U(0, 1), then F^-1(U) follows any distribution with CDF F, where F^-1 is the inverse CDF (quantile function). This inverse-transform method generates exponential, normal, binomial, and virtually any other distribution from uniform draws. That is why random number generators produce U(0, 1) as their primitive output.