Skip to main content

Uniform Distribution Calculator

The uniform distribution is the simplest continuous distribution there is: every value between two bounds is exactly as likely as any other. Its density is flat, so a probability is nothing more than the share of the interval that a range covers.

Probabilities at a point, the value at a probability, the chance of a window, or a generated sample.

Nothing below this value can be drawn. Negative bounds are fine.

Must be above the lower bound. The width b − a is the only thing that shapes the distribution.

The point you want probabilities at. Values outside the bounds give 0% or 100%.

For example 0.25 for the lower quartile or 0.9 for the value that 90% of draws fall below.

The window is clipped to the bounds, so parts hanging outside cannot be hit.

Must not be below x1. A window twice as wide anywhere on the interval has the same probability.

Fixes the generated values, so the same seed always reproduces the same sample.

Calculated Result
50%

P(X ≤ x)

Cumulative probability

50%

Probability of the exact value

0

Probability above x

50%

Distance from the lower bound

5

Density at x

0.1

Mean

5

Variance

8.333333

Standard deviation

2.886751

Density (constant)

0.1

Interval width (b - a)

10

Skewness

0

Excess kurtosis

-1.2

Probability of one threshold — Wide interval; density 0.1 throughout.

Calculation Breakdown

  1. Measure the fraction of the interval reachedFrom 0 to 5 there is 5 of the 10 the interval spans, and a uniform distribution spreads its probability evenly along it.P(X≤x)=x−ab−aP(X \le x) = \frac{x - a}{b - a}
  2. Read the densityInside the interval the density is the constant 0.1, so no part of the range is favoured over any other.f(x)=1b−afor a≤x≤bf(x) = \frac{1}{b-a} \quad \text{for } a \le x \le b

Density of the uniform distribution

Interactive visualization based on your current inputs

Density f(x)
0.00.30.50.81.0-1.5-1.283333-1.066667-0.85-0.633333-0.416667-0.20.0166670.2333330.450.6666670.8833331.11.3166671.5333331.751.9666672.1833332.42.6166672.8333333.053.2666673.4833333.73.9166674.1333334.354.5666674.78333355.2166675.4333335.655.8666676.0833336.36.5166676.7333336.957.1666677.3833337.67.8166678.0333338.258.4666678.6833338.99.1166679.3333339.559.7666679.98333310.210.41666710.63333310.8511.06666711.28333311.5xDensity

What Is the Uniform Distribution Calculator?

The continuous uniform distribution assigns equal likelihood to every value in an interval [a, b]. It is the distribution of a point placed at random with no preference for any region, and it is the starting point of probability theory because its probabilities are lengths.

It is described by exactly two parameters, and even those are redundant in practice: once the width b − a and the position are known, everything else follows. There is no shape parameter, so there is nothing to fit and nothing to tune.

How Does the Uniform Distribution Calculator Work?

The density is the constant 1/(b − a) across the interval and zero outside it. Because the area under a density must be one, a rectangle of height 1/(b − a) and width b − a has area exactly 1, whatever the bounds are.

The cumulative distribution is the fraction of the interval already passed: (x − a)/(b − a), clamped to 0 below a and 1 above b. Integrating the constant density gives that straight line, which is why the probability scale and the value scale are the same thing here.

The quantile formula inverts it directly: q(p) = a + p(b − a). Move p of the way across the interval and you are at the pth percentile, which is why the median needs no work at all — it is the midpoint.

The moments come from averaging over the interval rather than from any clever integral. The mean is the midpoint, the variance is the width squared over twelve, and the standard deviation is the width over √12 ≈ 3.4641. The distribution is symmetric, so the skewness is exactly zero, and its excess kurtosis is −6/5.

Uniform Distribution Calculator Formula & Variables

The core mathematical equation utilized by this calculator is expressed as:

f(x)=1b−aF(x)=x−ab−aQ(p)=a+p(b−a)E[X]=a+b2Var⁡(X)=(b−a)212f(x) = \frac{1}{b-a} \qquad F(x) = \frac{x-a}{b-a} \qquad Q(p) = a + p(b-a) \qquad E[X] = \frac{a+b}{2} \qquad \operatorname{Var}(X) = \frac{(b-a)^2}{12}

Variable Definitions

SymbolVariable Meaning & Units
alower bound of the interval
bupper bound of the interval
xthe value you want probabilities at
pprobability between 0 and 1

Measure how far x sits between the bounds and divide by the width, and the share is the probability: (x − a)/(b − a). The density is the reciprocal of the width, so the area under the curve is exactly one. Solving the same expression for x gives the quantile, and the moments follow by averaging over the interval, which is why the variance is the width squared over twelve.

How to Use the Uniform Distribution Calculator

  1. Enter the lower and upper bounds in whatever units you are working in. Only their difference affects probabilities, so leave the units consistent across both fields.
  2. In probability mode, type any value x. The answer is P(X ≤ x), the share above it, the density there and the probability of that exact value, which is always zero for a continuous distribution.
  3. In quantile mode, enter a probability such as 0.25 or 0.9 to get the value that share of draws fall below. The step also shows the round trip back through the cumulative distribution.
  4. In interval mode, give the two ends of a window. The calculator clips it to the bounds before dividing, so a window that overhangs an edge is scored on the part that can actually be reached.
  5. In sample mode, choose how many values to draw and a seed. The values appear in a table, with the sample mean and standard deviation next to the theoretical ones, and a note on whether the values covered every sub-interval evenly.

Step-by-Step Example Calculation

A wait time uniform between 0 and 10 minutes

Input Values:

mode:probability
a:0
b:10
x:3
Worked Steps: P(X ≤ 3) = 3/10 = 30%, because 3 of the 10 minutes lie below 3, and the density there is the constant 0.1 per minute.

Understanding Your Result

A probability such as 30% means that in the long run 30 out of every 100 independent draws would fall below that value. It says nothing about any single draw.

The density is a rate, not a probability. The constant 0.1 per minute on [0, 10] means probability accumulates at 10% per minute, and a single minute with no width contributes nothing.

The standard deviation is a fixed share of the width: 0.2887 of it. Doubling the interval doubles the spread, so relative variability never changes and only the absolute scale does.

The sample mode is one realisation, so its mean will differ from (a + b)/2. That gap shrinks roughly as 1/√n and is not an error in either number.

Factors That Affect the Result

  • The width b − a. It is the only thing that matters: it sets the density, the standard deviation, the variance and every quantile position. Widths of 20 minutes and 20 kilometres behave identically.
  • The position of the interval. Shifting both bounds moves every value but leaves every probability exactly where it was, which is worth checking when a result looks surprising.
  • Where you measure. A threshold close to the lower bound gives a small probability, one at the midpoint gives 50%, and one past the upper bound gives 100%, all because of where it falls on that flat line.
  • Sample size in sample mode. The spread of the generated values around the true mean narrows as more values are drawn, and empty stretches of the interval fill in.

When Should You Use This Calculator?

  • Any situation where a value is chosen from a range with no preference, such as a position along a line or a point inside a shape.
  • Baseline and worst-case reasoning: if nothing is known about the distribution except that it lies in [a, b], the uniform is the least committal assumption available.
  • Simulation inputs that must stay inside known limits, such as arrival times, jitter or randomised scheduling.
  • Teaching and checking distributions: the uniform is the clearest illustration of a flat density, a linear CDF and zero skewness.
  • Quick estimates where an interval is genuinely all you know, such as a bounded physical quantity with no other information.

Assumptions & Limitations

  • Uniformity is a strong claim. Real quantities are rarely exactly flat over a range; a value that merely looks spread out may be rounded, truncated or clipped.
  • Both bounds must be genuine limits. Nothing outside [a, b] is ever produced, so a real process with heavier tails is misrepresented by this model.
  • There is no shape parameter, so the model cannot capture any preference within the range. If the data clusters anywhere, it is not uniform.
  • Generated samples are independent draws. Real processes are often correlated in time, and consecutive draws from this generator are not.
  • Points have zero probability. If your data is rounded to whole units, the continuous model understates the chance of small buckets, which is why the sample mode reports how evenly the sub-intervals were covered.

Frequently Asked Questions

Calculation Accuracy & Reference Note

Every result comes from closed-form arithmetic on the bounds, with no numerical integration or iteration, so the probabilities and moments are exact to the precision shown. Generated samples use inverse transform sampling from a seeded linear congruential generator, which makes them reproducible rather than random on each visit.

Standard Reference: NIST/SEMATECH e-Handbook of Statistical Methods, section 8.3.5, Uniform Distribution (Univariate).