Uniform Distribution PDF/PMF Value Calculator

Compute uniform distribution values for continuous and discrete models, fast and accurate. Validate bounds, endpoints, and integer support automatically during input and computation checks. See PDF or PMF with mean, variance, and width, instantly displayed. Export results to CSV or PDF with one click.

Calculator All fields marked * are required


Calculated Rows
# Model a/m b/n x/k PDF/PMF Mean Variance Width / Support Size Timestamp

Tip: use Add to Table after each run, then export.

Example Data
# Model a/m b/n x/k Expected PDF/PMF
1 Continuous 0 5 2 0.2
2 Continuous -3 1 -3 0.25
3 Discrete 1 6 4 1/6 ≈ 0.1666667
4 Discrete 10 14 9 0 (outside support)

Click Load to populate the form with the row values.

Formulas Used

Continuous Uniform, $X \\sim \\mathrm{Unif}(a,b)$ with $a < b$:

  • PDF: $f_X(x)=\\begin{cases}\\dfrac{1}{b-a}, & a \\le x \\le b \\\\ 0, & \\text{otherwise}\\end{cases}$
  • Mean: $\\mathbb{E}[X]=\\dfrac{a+b}{2}$
  • Variance: $\\mathrm{Var}(X)=\\dfrac{(b-a)^2}{12}$

Discrete Uniform on integers $m, m+1,\\dots,n$ with $m \\le n$:

  • PMF: $p_X(k)=\\begin{cases}\\dfrac{1}{n-m+1}, & k \\in \\{m,\\dots,n\\} \\\\ 0, & \\text{otherwise}\\end{cases}$
  • Mean: $\\mathbb{E}[X]=\\dfrac{m+n}{2}$
  • Variance: $\\mathrm{Var}(X)=\\dfrac{(n-m+1)^2-1}{12}$

Endpoint convention: For the continuous case, the value on the boundary has the same constant PDF as the interior.

How to Use This Calculator
  1. Choose Continuous or Discrete from the Model menu.
  2. Enter bounds and the evaluation point. Ensure $a<b$ or $m\\le n$.
  3. Click Compute Value to see PDF/PMF, mean, and variance.
  4. Click Add to Table to accumulate multiple scenarios.
  5. Use Download CSV or Download PDF to export results.

For discrete mode, k must be an integer in $[m,n]$ when integer enforcement is enabled.

What is uniform distribution PDF/PMF Value?

PDF (continuous): For $X\sim \mathrm{Unif}(a,b)$, the value $f_X(x)$ is the height of the density at $x$. It equals $\tfrac{1}{b-a}$ when $a\le x\le b$ and $0$ otherwise. A PDF is not a probability at a single point; probabilities come from areas: $\mathbb{P}(x_1\le X\le x_2)=\int_{x_1}^{x_2} f_X(x)\,dx$.

PMF (discrete): For $X$ uniform on the integers $\{m,\dots,n\}$, the value $p_X(k)$ is the probability of $X=k$. It equals $\tfrac{1}{n-m+1}$ when $k$ is an integer in $[m,n]$, and $0$ otherwise.

Units: PDF has units of $1/\text{(units of }X\text{)}$; PMF is dimensionless. Endpoint handling for the continuous case is conventional; this tool uses $[a,b]$ inclusion by default.

What is the CDF?

Cumulative Distribution Function (CDF) gives the probability that a random variable is less than or equal to a value.

Continuous Uniform, $X\sim \mathrm{Unif}(a,b)$: $$ F_X(x)=\begin{cases} 0,& xb \end{cases} $$

Discrete Uniform on integers $\{m,\dots,n\}$: $$ F_X(x)=\begin{cases} 0,& xn \end{cases} $$ (At integer $k$, $F_X(k)=\dfrac{k-m+1}{n-m+1}$.)

CDFs are monotone non-decreasing and always range from 0 to 1.

Quick CDF Examples
# Model Parameters Point Computation Result
1 Continuous $a=0,\;b=5$ $x=2$ $(2-0)/(5-0)$ $0.4$
2 Continuous $a=0,\;b=5$ $x=-1$ $x $0$
3 Continuous $a=-3,\;b=1$ $x=1$ $(1-(-3))/(1-(-3))$ $1$
4 Discrete $m=1,\;n=6$ $x=4$ $(4-1+1)/(6)$ $\frac{4}{6}\approx 0.6666667$
5 Discrete $m=10,\;n=14$ $x=9$ $x $0$
6 Discrete $m=10,\;n=14$ $x=14$ $(14-10+1)/(5)$ $1$

These examples illustrate how CDFs accumulate probability up to a point.

What is an important similarity between the uniform and normal probability distributions?

Key similarity (continuous case): symmetry about the mean. Both the continuous uniform $\\mathrm{Unif}(a,b)$ and the normal $\\mathcal{N}(\\mu,\\sigma^2)$ are symmetric around their center: the midpoint $\\tfrac{a+b}{2}$ for uniform and the mean $\\mu$ for normal. Formally, $$f\\big(\\text{center}+d\\big)=f\\big(\\text{center}-d\\big).$$ For uniform, $\\text{center}=\\tfrac{a+b}{2}$; for normal, $\\text{center}=\\mu$.

  • Two-parameter families: Uniform uses $(a,b)$; normal uses $(\\mu,\\sigma)$. Each pair fully determines the distribution.
  • Area under the curve gives probability: For both, probabilities are obtained by integrating the density over intervals.
  • Finite mean and variance: $\\mathbb{E}[X]=\\tfrac{a+b}{2}$, $\\mathrm{Var}(X)=\\tfrac{(b-a)^2}{12}$ for uniform; $\\mathbb{E}[X]=\\mu$, $\\mathrm{Var}(X)=\\sigma^2$ for normal.
  • CLT connection: The sample mean of many i.i.d. draws from either distribution is approximately normal (Central Limit Theorem).

Note: The discrete uniform shares the two-parameter and finite-moment properties, but its PMF is not continuous.

PDF Quick Reference (Continuous)
# a b Width (b−a) x In Range? PDF = 1/(b−a)
10552Yes0.2
2-314-1Yes0.25
32313Yes1
41436No0

For any x outside [a,b], the PDF value is 0.

PMF Quick Reference (Discrete)
# m n Support Size (n−m+1) k In Support? PMF = 1/(n−m+1)
11664Yes0.1666667
2101459No0
3-2250Yes0.2
43313Yes1

When the support has one integer, the PMF at that integer equals 1.

Moments and Interval Metrics
# Model Parameters Mean Variance Width / Size Notes
1 Continuous a=0, b=5 2.5 25/12 ≈ 2.083333 5 PDF constant at 0.2 on [0,5].
2 Continuous a=-3, b=1 -1 16/12 ≈ 1.333333 4 Symmetric about -1, endpoints included by default.
3 Discrete m=1, n=6 3.5 35/12 ≈ 2.916667 6 Fair die; PMF is 1/6 at each face.
4 Discrete m=10, n=14 12 24/12 = 2 5 Five equally likely integers from 10 to 14.

Formulas: mean $(a+b)/2$ or $(m+n)/2$; variance $(b-a)^2/12$ or $\big((n-m+1)^2-1\big)/12$.

Related Calculators

Pareto Distribution Quantile Percent Point CalculatorCauchy Distribution CDF Value CalculatorLaplace Distribution CDF Value CalculatorGeometric Distribution Moments Mean Variance CalculatorNegative Binomial Distribution PDF/PMF Value CalculatorPoisson Distribution Random Sample Summary CalculatorPoisson Distribution Moments Mean Variance CalculatorDiscrete Uniform Distribution Moments Mean Variance Calculator

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.