Roboculator
Online CalculatorsCategoriesDate & EventsNews
Get Started
Online CalculatorsCategoriesDate & EventsNewsGet Started
Roboculator

Smart calculators for every challenge. Free, fast, and private.

Categories

  • Finance
  • Health
  • Math
  • Construction
  • Conversion
  • Everyday Life

Popular Tools

  • Date & Events
  • Loan Calculator
  • BMI Calculator
  • Percentage Calc
  • Latest News
  • Search All

Resources

  • Glossary
  • Topic Tags
  • News & Insights

Company

  • About
  • Contact

Legal

  • Privacy Policy
  • Terms of Service
  • Editorial Policy
  • Disclaimer
© 2026 Roboculator. All rights reserved.
Roboculator

roboculator.com

  1. Home
  2. /Math
  3. /Probability Distributions
  4. /Uniform Distribution Calculator

Uniform Distribution Calculator

Last updated: March 15, 2026

Calculator

Results

Enter values to see results

PDF f(x)

—

CDF F(x)

—

Mean

—

Variance

—

Standard Deviation

—

Median

—

Entropy

—

Results

Enter values to see results

PDF f(x)

—

CDF F(x)

—

Mean

—

Variance

—

Standard Deviation

—

Median

—

Entropy

—

The Uniform Distribution Calculator computes probability values and statistics for the continuous uniform distribution on the interval $$[a, b]$$. This distribution assigns equal probability to all values within the interval, making it one of the simplest and most commonly used distributions in probability theory and simulation.

The Continuous Uniform Distribution

A random variable $$X$$ follows a uniform distribution on $$[a, b]$$ if every value in the interval is equally likely. The probability density function is:

$$f(x; a, b) = \begin{cases} \frac{1}{b - a} & \text{if } a \leq x \leq b \\ 0 & \text{otherwise} \end{cases}$$

The cumulative distribution function is:

$$F(x; a, b) = \begin{cases} 0 & \text{if } x < a \\ \frac{x - a}{b - a} & \text{if } a \leq x \leq b \\ 1 & \text{if } x > b \end{cases}$$

Statistical Properties

The mean and median of the uniform distribution are both equal to the midpoint of the interval: $$E[X] = \frac{a + b}{2}$$. The variance is $$\text{Var}(X) = \frac{(b - a)^2}{12}$$, which depends only on the width of the interval. The distribution has zero skewness (perfectly symmetric) and a kurtosis of $$-\frac{6}{5}$$ (platykurtic, meaning lighter tails than a normal distribution).

Maximum Entropy Property

Among all continuous distributions supported on a finite interval $$[a, b]$$, the uniform distribution has the maximum entropy $$H = \ln(b - a)$$. This makes it the distribution that encodes the least information beyond knowing the range, which is why it is used as a non-informative prior in Bayesian statistics.

Applications

The uniform distribution is widely used in random number generation, Monte Carlo simulation, and as a building block for generating other distributions via inverse transform sampling. It models scenarios where outcomes are equally likely within a known range, such as rounding errors, random arrival times within a fixed window, or selecting a random point on a line segment.

How to Use This Calculator

Enter the minimum $$a$$, maximum $$b$$ (where $$b > a$$), and a value $$x$$. The calculator computes the PDF, CDF, mean, variance, standard deviation, median, and differential entropy of the distribution.

How It Works

The calculator evaluates the uniform PDF as $$1/(b-a)$$ when $$x$$ falls within $$[a, b]$$, and 0 otherwise. The CDF is computed as $$(x - a)/(b - a)$$, clamped to the range $$[0, 1]$$. All statistical measures are derived from the standard formulas for the continuous uniform distribution.

Understanding Your Results

The constant PDF value indicates that all points in $$[a, b]$$ are equally likely. The CDF increases linearly from 0 at $$x = a$$ to 1 at $$x = b$$. If $$x$$ is outside the interval, the PDF is 0 and the CDF is either 0 (below $$a$$) or 1 (above $$b$$). A wider interval produces a smaller PDF value since the total probability of 1 is spread over a larger range.

Worked Examples

Standard Uniform U(0, 10)

Inputs

a0
b10
x5

Results

pdf0.1
cdf0.5
mean val5
variance8.333333
std dev2.886751
median5
entropy2.302585

For U(0, 10), the PDF is constant at 0.1 throughout the interval. At x = 5 (the midpoint), the CDF is 0.5, confirming the median equals the mean.

Uniform U(2, 8) at x = 6

Inputs

a2
b8
x6

Results

pdf0.16666667
cdf0.66666667
mean val5
variance3
std dev1.732051
median5
entropy1.791759

For U(2, 8) with range 6, the PDF is 1/6 ≈ 0.167. At x = 6, the CDF is (6−2)/(8−2) = 2/3 ≈ 0.667, meaning 66.7% of the distribution lies below x = 6.

Frequently Asked Questions

A uniform distribution assigns equal probability to all outcomes in its support. For the continuous uniform distribution on $$[a, b]$$, this means the PDF is constant: $$f(x) = 1/(b-a)$$ for all $$x$$ in the interval.

The discrete uniform distribution assigns equal probability to a finite set of distinct values (e.g., rolling a fair die), while the continuous uniform distribution assigns equal probability density to all points in a continuous interval $$[a, b]$$.

Most random number generators produce uniform random numbers on $$[0, 1]$$. Through inverse transform sampling, these uniform values can be converted to any other distribution, making the uniform distribution the foundation of Monte Carlo simulation.

For a uniform distribution on $$[a, b]$$, the probability $$P(x_1 \leq X \leq x_2) = \frac{x_2 - x_1}{b - a}$$ when both $$x_1$$ and $$x_2$$ are within $$[a, b]$$. Simply compute the CDF difference: $$F(x_2) - F(x_1)$$.

If $$a = b$$, the distribution is degenerate (a single point with probability 1). The PDF becomes a Dirac delta function and the variance is zero. This calculator returns NaN for invalid inputs where $$b \leq a$$.

The differential entropy is $$H = \ln(b - a)$$. Among all continuous distributions on $$[a, b]$$, the uniform distribution has the maximum entropy, making it the "most uncertain" distribution given only the range constraint.

Sources & Methodology

Casella, G. & Berger, R. L. (2002). Statistical Inference (2nd ed.). Duxbury Press. Devroye, L. (1986). Non-Uniform Random Variate Generation. Springer-Verlag.
R

Roboculator Team

The Roboculator Team explains calculations, planning tools, and practical formulas in clear language for real-life situations.

How helpful was this calculator?

Be the first to rate!

Related Calculators

Exponential Distribution Calculator

Probability Distributions

Geometric Distribution Calculator

Probability Distributions

Hypergeometric Distribution Calculator

Probability Distributions

Negative Binomial Distribution Calculator

Probability Distributions

Gamma Distribution Calculator

Probability Distributions

Weibull Distribution Calculator

Probability Distributions