Uniform Distribution Calculator

Enter bounds, pick options, and get exact answers. View PDF, CDF, quantiles, and samples fast. Built for students, analysts, and quick homework checks today.

Calculator

Discrete mode treats a and b as integers.
0–12 decimals for displayed outputs.
Tip: you can tick multiple outputs at once.
Used for PDF/PMF and CDF.
Used for inverse CDF (quantile).
Max 5000. Preview shows first 200.
Interval endpoint.
Interval endpoint.
Reset
Results appear above this form after you calculate.

Example Data Table

These examples show typical inputs and outputs you can reproduce.

Continuous example
Uniform(a,b)xPDFCDFP(2≤X≤7)Mean
a=0, b=10 3 0.1 0.3 0.5 5
Variance here is (10−0)²/12 = 8.3333…
Discrete example
Uniform{a..b}xPMFCDFP(2≤X≤5)Mean
a=1, b=6 4 0.1667 0.6667 0.6667 3.5
This matches a fair six‑sided die.

Formula Used

Continuous Uniform(a, b) (a < b):

  • PDF: f(x)=1/(b−a) for a≤x≤b, else 0
  • CDF: 0 if x<a; (x−a)/(b−a) if inside; 1 if x>b
  • Mean: μ=(a+b)/2
  • Variance: σ²=(b−a)²/12, Std: σ=√σ²
  • Quantile: Q(p)=a+p(b−a) for 0≤p≤1

Discrete Uniform{a, …, b} (integers, a ≤ b), with k=b−a+1:

  • PMF: P(X=x)=1/k for integer x in range, else 0
  • CDF: F(x)=(⌊x⌋−a+1)/k, clamped to [0,1]
  • Mean: μ=(a+b)/2
  • Variance: σ²=(k²−1)/12
  • Quantile: smallest integer value with CDF ≥ p

How to Use This Calculator

  1. Choose continuous or discrete mode.
  2. Enter bounds a and b (with b greater or equal).
  3. Select outputs: stats, PDF/PMF, CDF, quantile, interval, sample.
  4. Fill needed inputs: x, p, x1/x2, and sample size n.
  5. Press Calculate; results appear above the form.
  6. Use the download buttons to export CSV or PDF.

FAQs

1) What is a uniform distribution?

It models outcomes where every value in a range is equally likely. Continuous uniform spreads probability evenly over an interval, while discrete uniform assigns equal probability to each integer in a set.

2) When should I use continuous vs discrete?

Use continuous for measurements like time or distance within bounds. Use discrete for integer outcomes like dice, random IDs, or selecting a whole-number value from a range.

3) Why must b be greater than a in continuous mode?

A continuous uniform needs a positive interval width. If b equals or is less than a, the interval has zero or negative length, so the PDF and CDF formulas no longer define a valid distribution.

4) What does PDF/PMF at x mean?

For continuous mode, the PDF is a density, not a direct probability. For discrete mode, the PMF gives the exact probability of that integer value occurring.

5) How is the interval probability computed?

Continuous mode uses the interval length inside [a,b] divided by (b−a). Discrete mode counts integers inside the interval and divides by the total count k = b−a+1.

6) What is the quantile and why is p between 0 and 1?

The quantile returns the value x such that the CDF reaches probability p. Since CDF values range from 0 to 1, p must also lie within that same range.

7) Are the random samples truly random?

They are pseudo-random values generated by the server. They are suitable for simulations and practice, but not recommended for cryptographic or security-sensitive uses.

8) Why might my PMF be zero in discrete mode?

The PMF is nonzero only for integers between a and b. If you enter a non-integer x, or an integer outside the bounds, the calculator returns 0 because that outcome cannot occur.

Educational tool only. Double-check critical calculations.

Related Calculators

F-Test Statistic CalculatorMultiple Regression Summary Calculatorsign test calculatorgoodness of fit calculatorempirical rule calculatorroot mean square calculatorpoisson distribution calculatorcritical value calculatorspearman rank calculatorz table 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.