Probability Distributions

Uniform Distribution Calculator

Use this uniform distribution calculator to find probabilities for a continuous uniform distribution. Enter the lower bound (a), upper bound (b), and value or interval to get an instant answer with a clear step-by-step solution.

Enter the smallest possible value of X.
Enter the largest possible value of X.
Since the uniform distribution is continuous, including or excluding endpoints gives the same probability.

How to Use the Uniform Distribution Calculator

This calculator helps you find probabilities for a continuous uniform distribution. To use the calculator:

  1. Enter the lower bound, a.
  2. Enter the upper bound, b.
  3. Enter the value of x. For a between-or-outside probability, enter the lower value, c, and upper value, d.
  4. Select the probability you want to find.
  5. Choose the number of decimal places for the final answer.
  6. Click Calculate.

The calculator returns the requested probability and shows how it was calculated step by step using the uniform probability density function and integration. It also provides the mean and standard deviation of the distribution.

With this free uniform distribution calculator, you can find:

  • Probability that X is less than x, P(X < x)
  • Probability that X is greater than x, P(X > x)
  • Probability that X is between c and d, P(c < X < d)
  • Probability that X is outside c and d, P(X < c or X > d)

Tip. Since the uniform distribution is continuous, including or excluding an endpoint does not change the probability. Therefore, P(X < x) = P(X ≤ x) and P(X > x) = P(X ≥ x).

What Is a Uniform Distribution?

A continuous uniform distribution is a probability distribution in which the probability density is constant between a lower bound, a, and an upper bound, b.

It is commonly written as: X ~ U(a, b)

where:

  • a is the smallest possible value of X.
  • b is the largest possible value of X.
  • X can take any value between a and b.

For example, suppose a bus is expected to arrive at any time between 0 and 12 minutes, and every part of that time interval is equally likely. The waiting time can be modeled using a continuous uniform distribution from 0 to 12.

The graph of the probability density function is a rectangle because the density has the same height throughout the interval from a to b.

When Should You Use a Uniform Distribution?

A continuous uniform distribution may be appropriate when:

  • the random variable is continuous;
  • it can take values only between two known bounds;
  • the probability density is constant throughout the interval; and
  • equal-length intervals have equal probabilities.

For example, a uniform distribution may be used to model:

  • a waiting time that can occur anywhere within a fixed interval;
  • a randomly selected point along a line segment;
  • a random number generated between two limits;
  • a measurement error assumed equally likely within a specified range; or
  • an arrival time that can occur anywhere within a known time window.

The key idea is that probability depends only on the length of the interval.

Uniform Distribution Probability Density Function

For a continuous uniform distribution from a to b, the probability density function is:

f(x)={1ba,axb, 0,otherwisef(x)= \begin{cases} \dfrac{1}{b-a}, & a\leq x\leq b,\ 0, & \text{otherwise} \end{cases}

This means the density is constant between a and b and zero everywhere else. The value 1/(b − a) is the height of the uniform distribution.

For example, suppose X is uniformly distributed between 0 and 10. Then, f(x) = 1/(10 − 0)

= 1/10

= 0.1

Therefore, the probability density has a constant height of 0.1 between 0 and 10.

Uniform Distribution Probability Formulas

The formula you use depends on the probability you want to find. These are summarized below.

1. Probability Less Than x

To calculate P(X < x), integrate from the lower bound a to x: P(X<x)=ax1ba,dtP(X<x)=\int_a^x\frac{1}{b-a},dt

After integrating, the formula becomes: P(X<x)=(xa)/(ba)P(X < x) = (x − a)/(b − a) for a < x < b.

2. Probability Greater Than x

To calculate P(X > x), integrate from x to the upper bound b. That’s: P(X>x)=xb1ba,dtP(X>x)=\int_x^b\frac{1}{b-a},dt

After integrating, the simplified formula for probability greater than x becomes: P(X > x) = (b − x)/(b − a) for a < x < b.

3. Probability Between c and d

For a < c < d < b, P(c<X<d)=cd1ba,dtP(c<X<d)=\int_c^d\frac{1}{b-a},dt

Therefore, P(c < X < d) = (d − c)/(b − a)

4. Probability Outside c and d

An outside probability includes two separate regions: values below c and values above d.

Therefore, P(X<c or X>d)=ac1ba,dt+db1ba,dtP(X<c\text{ or }X>d) = \int_a^c\frac{1}{b-a},dt + \int_d^b\frac{1}{b-a},dt

After evaluating the integrals, the simplified formula for finding probabilities outside c and d in a continuous uniform distribution is: P(X < c or X > d) = (c − a)/(b − a) + (b − d)/(b − a). Alternatively, you can also use the complement rule: P(X < c or X > d) = 1 − P(c < X < d).

Why Does the Total Area Equal 1?

The total probability of any probability distribution must equal 1. For a uniform distribution, we can verify this by integrating the probability density from the lower bound a to the upper bound b: ab1ba,dx=1\int_a^b \frac{1}{b-a},dx=1

For example, if X ~ U(0, 10), we can verify it is a probability distribution function as follows:

010110,dx\int_0^{10}\frac{1}{10},dx

Evaluating the integral gives:

[x10]010\left[\frac{x}{10}\right]_0^{10}

= 10/10 − 0/10

= 1

Therefore, the total area under the uniform distribution curve is 1. This is also why the height of the density must be 1/(b − a).

How to Calculate Uniform Distribution Probability

To find a probability from a continuous uniform distribution, integrate the probability density over the interval of interest.

In general, P(c<X<d)=cd1ba,dxP(c<X<d)=\int_c^d\frac{1}{b-a},dx provided c and d lie within the distribution interval from a to b.

Evaluating the integral gives: P(c < X < d) = (d − c)/(b − a)

Therefore, uniform probabilities can also be calculated by dividing the length of the favorable interval by the length of the entire interval. The interval-width formula is not a different method. It comes directly from integrating the constant probability density.

Example 1: Find P(X < x)

Suppose the waiting time for a university shuttle is uniformly distributed between 0 and 12 minutes. What is the probability that a student waits less than 5 minutes?

Solution

From the question, we know that:

  • Lower bound, a = 0
  • Upper bound, b = 12
  • x = 5

We need to find P(X < 5)

First, find the probability density.

f(x) = 1/(b − a)

= 1/(12 − 0)

= 1/12

Therefore, to find the probability that the waiting time is less than 5 minutes, we integrate the density from 0 to 5.

Thus, P(X<5)=05112,dtP(X<5)=\int_0^5\frac{1}{12},dt

Evaluating the integral gives:

P(X<5)=[t12]05P(X<5)=\left[\frac{t}{12}\right]_0^5

= 5/12 − 0/12

= 5/12 or 0.416667

This implies that the probability that the student waits less than 5 minutes for the shuttle is approximately 0.4167.

Example 2: Probability Between Two Values

A machine fills containers with an amount that is uniformly distributed between 490 mL and 510 mL. What is the probability that a randomly selected container contains between 495 mL and 504 mL?

Solution

From the question, we know that:

  • Lower bound, a = 490
  • Upper bound, b = 510
  • Lower value, c = 495
  • Upper value, d = 504

We need to find P(495 < X < 504)

To find the probability, we first need to calculate the uniform density:

f(x) = 1/(510 − 490)

= 1/20

Therefore, P(495<X<504)=495504120,dtP(495<X<504) = \int_{495}^{504}\frac{1}{20},dt

Evaluating the integral gives:

=[t20]495504= \left[\frac{t}{20}\right]_{495}^{504}

= (504 − 495)/20

= 9/20 or 0.45.

This implies that the probability that a randomly selected container contains between 495 mL and 504 mL is 0.45.

Example 3: Probability Outside Two Values

The completion time for a short computer process is uniformly distributed between 20 and 50 seconds. What is the probability that the process takes less than 25 seconds or more than 40 seconds?

Solution

From the question, we know that:

  • Lower bound, a = 20
  • Upper bound, b = 50
  • Lower value, c = 25
  • Upper value, d = 40

We need to find P(X < 25 or X > 40)

Calculating the probability density, we get: f(x) = 1/(50 − 20)

= 1/30

The outside probability contains two regions. Therefore, P(X<25 or X>40)=2025130,dt+4050130,dtP(X<25\text{ or }X>40) = \int_{20}^{25}\frac{1}{30},dt + \int_{40}^{50}\frac{1}{30},dt

Evaluating the first integral gives: (25 − 20)/30 = 5/30

Evaluating the second integral gives: (50 − 40)/30 = 10/30

Therefore, P(X < 25 or X > 40) = 5/30 + 10/30

= 15/30

= 0.50

This implies that the probability that the process takes less than 25 seconds or more than 40 seconds is 0.50.

Can You Find P(X = x) for a Uniform Distribution?

For a continuous uniform distribution, P(X = x) = 0. This is true for any single value of x.

For example, P(X = 4) = 0. This does not mean that X cannot take the value 4. It means that a continuous random variable has zero probability at any one exact point.

Probabilities are therefore calculated over intervals, such as:

  • P(X < 4)
  • P(X > 4)
  • P(2 < X < 6)

Also, do not confuse f(x) with P(X = x).

The value f(x) is the probability density, or the height of the density curve. It is not the probability of observing exactly x.

Mean and Standard Deviation of a Uniform Distribution

Besides the requested probability, the uniform distribution calculator also provides the mean and standard deviation.

The mean of a continuous uniform distribution is: μ = (a + b)/2. This is simply the midpoint between the lower and upper bounds.

For example, suppose X ~ U(0, 10). We can calculate the mean of the uniform distribution as follows:

μ = (0 + 10)/2

= 5

The variance of a continuous uniform distribution is σ² = (b − a)²/12, and the standard deviation is: σ = (b − a)/√12

For a = 0 and b = 10, the standard deviation is: σ = (10 − 0)/√12

= 10/√12

= 2.8868

Continuous Uniform vs. Discrete Uniform Distribution

A continuous uniform distribution and a discrete uniform distribution both involve equally likely outcomes, but the possible values are different.

A continuous uniform distribution can take any value within an interval. For example, a waiting time can be 4.1 minutes, 4.12 minutes, 4.123 minutes, and so on. On the other hand, a discrete uniform distribution has a finite set of individual possible outcomes. For example, a fair six-sided die has the possible outcomes: 1, 2, 3, 4, 5, and 6 with each outcome having probability 1/6.

This calculator is designed for the continuous uniform distribution.

Uniform Distribution vs. Normal Distribution

The uniform and normal distributions are both continuous distributions, but their shapes and probability patterns are very different.

In a uniform distribution, the probability density is constant throughout the interval from a to b. Equal-length intervals therefore have equal probabilities. However, in a normal distribution, values near the mean have a higher probability density than values farther away from the mean. Its probability density has the familiar bell shape.

For example, if X is uniformly distributed between 0 and 10, the interval from 1 to 2 has the same probability as the interval from 7 to 8 because both intervals have width 1. That is not generally true for a normal distribution.

Common Mistakes When Calculating Uniform Distribution Probability

Avoid these common mistakes:

  • Reversing the lower and upper bounds. The lower bound a must be less than the upper bound b.
  • Using the density as the probability. The value 1/(b − a) is the probability density, not generally the probability of an interval.
  • Forgetting to integrate over the requested interval. Probability is the area under the density curve between the relevant limits.
  • Using the full interval width as the numerator. The numerator should be the length of the interval whose probability you want to find.
  • Trying to calculate P(X = x) as a nonzero probability. For a continuous distribution, P(X = x) = 0.
  • Confusing continuous and discrete uniform distributions. A continuous uniform variable can take any value within an interval, while a discrete uniform variable has separate possible outcomes.
  • Ignoring the distribution bounds. Probability density is zero outside the interval from a to b.
  • Forgetting both regions in an outside probability. P(X < c or X > d) includes the area below c and the area above d.

Frequently Asked Questions

What is a uniform distribution calculator?

This is an online tool used to find probabilities for a continuous random variable with constant probability density between a lower bound and an upper bound. This calculator finds less than, greater than, between, and outside probabilities and also provides the mean, standard deviation, percentage, and a clear step-by-step solution using integration.

What do a and b mean in a uniform distribution?

In X ~ U(a, b), a is the lower bound and b is the upper bound of the distribution. The random variable X can take any value between these two limits.

What is the uniform distribution formula?

For a continuous uniform distribution from a to b, the probability density is: f(x) = 1/(b − a) for values of x between a and b. The density is 0 outside this interval.

How do you find probability in a uniform distribution?

To calculate the probability that X lies between two values, integrate the uniform probability density over the required interval: P(c<X<d)=cd1ba,dxP(c<X<d)=\int_c^d\frac{1}{b-a},dx. After integration, P(c < X < d) = (d − c)/(b − a) provided c and d lie within the distribution bounds.

What are the mean and standard deviation of a uniform distribution?

The mean of a continuous uniform distribution is μ = (a + b)/2, and its standard deviation is σ = (b − a)/√12

Cite

Choose APA, MLA, Chicago, or Harvard, then copy the citation.

Mburu, J.. (2026, September 2). Uniform Distribution Calculator. StatCalc.net. Retrieved September 11, 2026, from https://statcalc.net/uniform-distribution-calculator/

Joseph Mburu

About This Calculator

Prepared by Joseph Mburu · Updated on

Joseph is an applied statistician and data analyst with over 6 years of experience helping students, researchers, and professionals solve statistics and data analysis problems. He holds a degree in Applied Statistics and a Master’s degree in Data…

We aim to keep our calculators accurate, easy to use, and helpful for learning. Always check that your inputs match the assumptions of the method you are using.