Audited 31 Jul 2026·Last updated 28 Oct 2026·3 citations·Tier 2·0 uses

Uniform Distribution Calculator

For a uniform distribution between a and b, find the probability of a value at or below x, (x − a)/(b − a), and the flat density 1/(b − a).

Uniform Distribution Calculator

Cumulative probability
0.4
Probability that the quantity is at or below x, between 0 and 1; multiply by 100 for a percentage.
Probability density
0.1
Model scope
Continuous uniform model on a closed numeric interval; it does not test uniformity, estimate endpoints, represent a discrete uniform distribution, or model values outside the entered support.

Background.

Some uncertainty has no favourite value. Someone who turns up at a stop served by a bus every ten minutes, without checking the timetable, is as likely to wait 1 minute as 9. A random number generator asked for a value between 0 and 1 should hand out every stretch of that interval in equal measure. A reading rounded to the nearest whole unit hides an error anywhere within half a unit either side, with no reason to suspect one part of that range more than another.

The continuous uniform distribution models all of these. Probability is spread evenly between a lower bound a and an upper bound b, so its density graph is a flat-topped rectangle, and the chance of landing in any stretch depends only on how long the stretch is. A window covering 30% of the range collects 30% of the probability, wherever it sits.

That makes the arithmetic short. The density, the height of the rectangle, is 1 ÷ (b − a). The cumulative probability, the chance of a value at or below some x, is the fraction of the range lying to the left of x: (x − a) ÷ (b − a). The probability of any window follows by subtraction.

The uniform model is also the honest default when all you know about something is its limits. Measurement scientists use it for an error quoted only as plus or minus a tolerance, and simulation software starts from uniform random numbers and transforms them into the other distributions it needs.

The page works with non-negative values: a must be zero or more, x and b must be positive, and x has to lie inside the interval. For a range that crosses zero, shift all three values up by the same amount first.

What is uniform distribution calculator?

The continuous uniform distribution, written U(a, b), describes a random quantity that can take any value between a and b, with the same density everywhere in that range and none outside it. Its density graph is a rectangle of width b − a and height 1 ÷ (b − a), so the total area, which is the total probability, is exactly 1. Its mean is the midpoint (a + b) ÷ 2 and its standard deviation is (b − a) ÷ √12.

How to use this calculator.

  1. Enter the smallest possible value as lower bound a and the largest as upper bound b, in whatever unit the quantity uses — minutes, millimetres, dollars.
  2. Enter the value x you are asking about. The page reports the probability of a result at or below x; subtract it from 1 for the probability of a result above x.
  3. For the chance of landing between two values, run the page once for each and subtract the smaller cumulative probability from the larger.
  4. If your range includes negative numbers, add the same constant to a, b and x so that all three are non-negative; the probabilities are unchanged by the shift.

The formula.

f(x)=1/(b-a); F(x)=(x-a)/(b-a), a≤x≤b

Two formulas, both valid for a ≤ x ≤ b. The density is f(x) = 1 ÷ (b − a), a constant because no value is favoured, and sized so the rectangle beneath it has an area of exactly 1. The cumulative distribution function is F(x) = (x − a) ÷ (b − a), the share of the interval's length lying at or below x. F climbs in a straight line from 0 at the lower bound to 1 at the upper bound, gaining the same amount for every unit x advances. The width b − a governs everything: halve it and the density doubles, so each unit step in x carries twice the probability. Below a the cumulative probability would be 0 and above b it would be 1, but the page asks for an x between the bounds rather than returning those trivial values. Density is measured per unit of x, such as per minute or per millimetre, and is not a probability by itself.

A worked example.

Example

A bus runs every 10 minutes and you reach the stop at a random moment, so your wait is uniform between a = 0 and b = 10 minutes. The density is 1 ÷ (10 − 0) = 0.1 per minute: each minute of the range carries a tenth of the probability. The chance of waiting 4 minutes or less is (4 − 0) ÷ (10 − 0) = 4 ÷ 10 = 0.4, a 40% chance. The rest follows by subtraction. Waiting longer than 4 minutes has probability 1 − 0.4 = 0.6. Waiting between 4 and 7 minutes is F(7) − F(4) = 0.7 − 0.4 = 0.3. On average you wait the midpoint, 5 minutes, with a standard deviation of 10 ÷ √12, about 2.887 minutes.

upper Bound10
x Value4
lower Bound0

Frequently asked questions.

Why can the probability density come out greater than 1?
Density is not a probability; probability is the area under the density over some stretch. On an interval from 0 to 0.5 the density is 1 ÷ 0.5 = 2 per unit, yet the total area is 2 × 0.5 = 1, exactly as it must be. Narrow intervals always have tall densities.
Can I use this for the roll of a die?
Not directly. A die is a discrete uniform distribution: P(roll ≤ 4) is 4 ÷ 6, about 0.6667. Entering a = 1, b = 6 and x = 4 here gives 0.6, which is wrong for a die. If you want a continuous stand-in, widen the bounds by half a unit to 0.5 and 6.5 and ask about x = 4.5, which returns 0.6667.
What is the probability of getting exactly 4?
Zero, for any continuous distribution. A single point has no width, so it has no area under the density. Only intervals carry probability, which is also why the chance of a value below 4 and the chance of a value at or below 4 are the same number.
How do I turn a ± tolerance into a standard uncertainty?
If a specification says only ±0.5 mm, treat the true value as uniform across that 1 mm band. Its standard deviation is the half-width divided by √3, so 0.5 ÷ √3 is about 0.2887 mm. This rectangular-distribution rule is the usual way measurement-uncertainty budgets handle bare tolerances.
How can I tell whether my data really are uniform?
This page assumes uniformity rather than testing it. Plot a histogram with equal-width bins: uniform data give bars of roughly equal height, with no hump in the middle or pile-up at one end. For a formal check, a chi-square goodness-of-fit or Kolmogorov–Smirnov test compares your data with the flat shape.
Why won't the page accept a negative lower bound?
It is built for non-negative quantities, but the probabilities depend only on distances within the interval, so shifting works. A rounding error uniform between −0.5 and 0.5 becomes 0 to 1 after adding 0.5; the chance of an error of 0.2 or less is then found at x = 0.7, giving 0.7.

How this page was produced

Published by
Quanta Calculator
Primary sources
3 cited below
Method
f(x)=1/(b-a); F(x)=(x-a)/(b-a), a≤x≤b
Published
Last verified

Built with AI assistance and verified by automated tests against the cited sources — every worked example on this page is computed by the same code that runs the calculator. How we build and check calculators.

In this category

Embed

Quanta Pro

Paid features are coming later.

  • All 1560 calculators remain free
  • No billing is enabled
Coming soon