Beta Distribution Calculator

Beta distribution CDF P(X ≤ x), upper tail, pdf, mean, variance, mode, median and percentiles from the shape parameters α and β.

Greater than 0, up to 100,000. As a Bayesian prior: 1 + number of successes.
Greater than 0. As a Bayesian prior: 1 + number of failures.
%
For example 95 gives the value that 95% of X falls below.

Results

P(X ≤ 0.4)
0.5248
P(X > 0.4)
0.4752
Probability density f(x)
1.728
95th percentile
0.751395
Mean = α ÷ (α + β)
0.4
Variance = αβ ÷ ((α + β)²(α + β + 1))
0.04
Standard deviation
0.2
Mode = (α − 1) ÷ (α + β − 2) when α, β > 1
0.333333
Median
0.385728

How it’s calculated

The beta distribution describes a quantity that lives between 0 and 1, such as a proportion, a probability or a percentage complete. Its two shape parameters α and β control where the mass sits: α = β gives a symmetric curve, α > β leans toward 1, and α = β = 1 is the flat (uniform) distribution. In Bayesian statistics a beta(1 + successes, 1 + failures) distribution describes what you know about an unknown success rate after seeing the data.

PDF f(x) = x^(α−1)·(1 − x)^(β−1) / B(α, β), B(α, β) = Γ(α)Γ(β)/Γ(α + β) CDF F(x) = I_x(α, β), the regularized incomplete beta function Mean α / (α + β) Variance αβ / ((α + β)²·(α + β + 1)) Mode (α − 1)/(α + β − 2) for α, β > 1

Worked example: α = 2, β = 3, x = 0.4. For whole-number shapes the CDF equals a binomial sum, P(at least 2 successes in 4 trials with p = 0.4): 6(0.4)²(0.6)² + 4(0.4)³(0.6) + (0.4)⁴ = 0.3456 + 0.1536 + 0.0256 = 0.5248. The pdf is 0.4 × 0.6² ÷ B(2, 3) = 0.144 × 12 = 1.728, the mean is 2/5 = 0.4 and the mode is 1/3.

Frequently asked questions

What do α and β mean?

Think of α − 1 as a count of successes and β − 1 as a count of failures. Larger values make the distribution narrower around the mean α/(α + β). NIST writes the same parameters as p and q.

My variable runs from a to b, not 0 to 1. What do I do?

Rescale it: use (value − a) ÷ (b − a) as x. Multiply a percentile by (b − a) and add a to convert back; the mean becomes a + (b − a)·α/(α + β).

How is the beta used as a Bayesian prior?

Start from beta(1, 1), which is flat. After s successes and f failures the posterior for the success rate is beta(1 + s, 1 + f). Its 2.5th and 97.5th percentiles give a 95% credible interval.

How are the median and percentiles computed?

There is no closed formula, so the calculator solves I_x(α, β) = p by repeated halving (bisection) on the incomplete beta function.

Embed this calculator

Add this free calculator to your own website. Copy the code below into your page’s HTML:

Need this calculator branded, changed or built around your own prices?See custom business solutions →

Sources

Formulas are taken from the free public references above. Results are provided “as is” for informational and educational purposes only. See our disclaimer.

Added · Last updated · How we check our calculators

Spotted a mistake or missing option? Report a problem· Suggest a calculator