Skip to content

Uniform Distribution Calculator

Calculate continuous uniform density, cumulative probability and interval probability, with the exact overlap area highlighted.

Inputs

Processed in your browser.

Live preview · press Calculate to confirm results

The flat rectangle has height 1/(b − a) and total area 1. The highlighted part is the requested interval intersected with [a, b]; outside portions contribute zero.

Finite values up to ±10¹². Example: a = 2.

b > a; width at least 10⁻⁹. Example: b = 10.

Can be outside [a, b]. Example: 6.

Lower ≤ upper. Example: 4 to 8.

Result

Enter your values, then calculate.

How to use this calculator

Enter minimum a and maximum b, a point x for PDF and CDF, and the two bounds of a separate probability interval. All five fields are required. The initial example is a = 2, b = 10, x = 6 and interval [4, 8].

The point x and probability interval answer different questions. PDF evaluates the density at that point. CDF gives the probability of being at or below x. The main percentage gives the probability of being inside your requested interval. There is no mode to choose: one calculation displays these three clearly labelled results together. Change any value and calculate again to compare a new case.

The form starts with a valid example. Press Calculate immediately to run it. Focusing or first editing a numeric field clears all example numbers and any confirmed result once, while preserving new typing and unit selections. Later focus changes keep your own entries. The diagram updates with valid draft values; empty or invalid drafts retain a frame marked —. Calculate confirms the separate result and enables Copy result. Clear leaves inputs empty and never restores the example.

Reading density and probability

For a ≤ x ≤ b, the PDF is f(x) = 1/(b − a); outside this range it is zero. The CDF is zero at or below a, (x − a)/(b − a) between the endpoints, and one at or above b. This implementation includes both endpoints when displaying the PDF. Assigning another density value at an isolated endpoint would not change any interval probability.

Density is a height, not the probability of one exact value. It can exceed 1 when the distribution is narrower than one unit. A continuous random variable has P(X = x) = 0 at every single point, while a nonzero-width interval can have positive probability. If x has units, density has reciprocal units; probabilities remain dimensionless and are displayed as percentages.

How the shaded area is calculated

Let l and u be your interval bounds. The overlap starts at max(a, l) and ends at min(b, u). Its usable width is max(0, min(b, u) − max(a, l)). Divide that width by b − a to obtain the interval probability. Reversed interval bounds are rejected instead of silently swapped. Equal interval bounds are accepted and produce zero probability.

The diagram shows a flat density from a to b and zero outside. Its full rectangle has area one. Only the overlap is highlighted; requested portions outside the distribution are not given probability mass. The plot fits the distribution’s width, so compare the labelled density height and probability rather than physical screen area across different calculations. Scroll the diagram within its own area on narrow screens.

Two worked examples

For a = 2, b = 10, x = 6 and interval [4, 8], density is 1/8 = 0.125, displayed as 0.13, CDF is 50%, and interval probability is 50%. The overlap width is 4 out of a total width of 8. The plotted height uses the same label rounding, while all probabilities use the unrounded density internally.

For a = −3, b = 5, x = 7 and interval [−8, 1], the PDF at x is zero and CDF is 100%. Only [−3, 1] overlaps the support, giving 4/8 = 50%. If the interval is instead [−8, 9], the result is 100%. An interval [6, 9] has no overlap and gives 0%.

Input, precision and practical use

Inputs accept signed decimals, a decimal point or comma, and scientific notation such as 1e-6. Do not use thousands separators. Each magnitude must be at most 10¹²; b must exceed a by at least 10⁻⁹. These limits keep the numeric range explicit. Errors leave the entered values available for correction while keeping the result empty.

Ordinary results show up to two decimals with no unnecessary trailing zeroes. Very small nonzero results use scientific notation to preserve their meaning. Internal calculations keep full precision before display. Clear empties all fields and results; a successful calculation enables a text copy of the inputs and results.

Use this model for coursework or a stated equal-density assumption, such as an ideal waiting-time range. Equal bounds are not a valid continuous uniform distribution because the width would be zero. A flat model is an assumption, not evidence that observed data are uniform. This page does not generate samples, fit a distribution or make an automatic statistical decision.

Frequently asked questions

Can the PDF be greater than 1?

Yes. For U(0, 0.5), density is 2. Multiplying height 2 by width 0.5 still gives total area 1.

Do inclusive endpoints change the probability?

No. A single point has zero probability in a continuous distribution, so open or closed interval endpoints give the same result.

What happens outside [a, b]?

Density is zero. CDF is zero below a and one above b. Interval probability uses only the overlapping portion.

Are reversed bounds automatically corrected?

No. Set a < b and lower ≤ upper. Reversed bounds show an error so an accidental reversal is not hidden.