The Beta Distribution, Explained
After reading this you can compute densities, cumulative probabilities and quantiles for a beta distribution, and use it to describe an unknown proportion between 0 and 1.
What the beta distribution is
The beta distribution describes a quantity that lives on the interval from 0 to 1. Think of a proportion, a probability, or a rate: the fraction of visitors who click a button, the true success rate of a treatment, the share of defective parts in a batch. All of these are trapped between 0 and 1, and the beta distribution is the standard tool for putting a probability curve over that range.
It has two shape parameters, written \alpha and \beta, both positive. By changing them you get very different shapes: a flat line, a single hump, a U shape, or a curve pressed against either edge. That flexibility is why the beta appears constantly in Bayesian work as a prior for an unknown probability.
One hook: suppose you flip a possibly biased coin 5 times and see 1 head. A natural summary of your belief about the coin's true head-probability is a beta distribution with \alpha = 2 and \beta = 5. That curve peaks near 0.2 and tails off toward both ends. The rest of this article uses exactly that curve.
When to use it, and when not
Reach for the beta distribution when the number you care about is a fraction bounded by 0 and 1 and you want a smooth probability curve over it. Two common cases:
- Bayesian prior and posterior for a probability. If you model successes with a binomial process, the beta is its conjugate prior. Start with a beta, observe data, and the posterior is another beta with updated parameters.
- Modeling observed proportions directly. Percentages, market shares, and completion rates often fit a beta shape well.
Do not use it for quantities that can exceed 1 or go negative. Waiting times belong to the exponential or gamma families. Counts of events belong to the Poisson or negative binomial. Unbounded measurements usually fit the normal distribution. The beta is only for the closed interval [0, 1].
The formula and the intuition
The probability density function is
Here x is the proportion, \alpha and \beta are the positive shape parameters, and B(\alpha, \beta) is the beta function, a normalizing constant that makes the total area equal 1. It is defined by
where \Gamma is the gamma function, a continuous version of the factorial with \Gamma(n) = (n-1)! for whole numbers.
The intuition sits in the two exponents. The factor x^{\alpha - 1} pulls weight toward 1 as \alpha grows, and (1 - x)^{\beta - 1} pulls weight toward 0 as \beta grows. If you picture data, \alpha - 1 acts like a count of successes and \beta - 1 like a count of failures. With \alpha = \beta = 1 both exponents vanish and you get the flat uniform curve on [0, 1], the same one the uniform distribution gives.
Two summary numbers help you read any beta at a glance:
The mode formula applies when both \alpha \gt 1 and \beta \gt 1. For \alpha = 2, \beta = 5 the mean is 2/7 = 0.2857 and the mode is 1/5 = 0.2.
A worked example with alpha = 2, beta = 5
This reproduces the calculator's demo values: \alpha = 2, \beta = 5, and value x = 0.3.
Density and cumulative probability at x = 0.3
- Compute the beta function. B(2, 5) = \Gamma(2)\Gamma(5)/\Gamma(7) = (1! \cdot 4!)/6! = 24/720 = 0.03333.
- Evaluate the numerator at
x = 0.3: 0.3^{1} \cdot 0.7^{4} = 0.3 \times 0.2401 = 0.07203. - Divide: the density is f(0.3) = 0.07203 / 0.03333 = 2.161.
- The cumulative probability is the area to the left of 0.3. Integrating gives P(X \le 0.3) = 0.5798. So about 58% of the curve's mass sits below 0.3.
A density of 2.161 is not a probability. It is the height of the curve. Only areas under the curve are probabilities, which is why the density can exceed 1.
The plotted point at x = 0.3 reads 2.161 to match the worked calculation. The smooth curve elsewhere follows the same formula, so the two are consistent.
Reading and interpreting results
The calculator runs in two directions. In probability mode you give a value x and read the density and the cumulative probability P(X \le x). In critical mode you give a cumulative probability p and read back the quantile, the value x with that much area to its left.
For the demo curve, a few quantiles are worth memorizing as sanity checks:
| Cumulative probability p | Quantile x |
|---|---|
| 0.05 | 0.06285 |
| 0.25 | 0.1626 |
| 0.50 | 0.2644 |
| 0.75 | 0.3866 |
| 0.95 | 0.5818 |
Read the last row this way: there is a 95% chance the value falls at or below 0.5818, so only 5% of the mass sits above it. The median 0.2644 is slightly below the mean 0.2857, which tells you the distribution is skewed to the right. That right skew is typical whenever \beta \gt \alpha.
Common mistakes
The density value is not a probability. At x = 0.3 the density is 2.161, well above 1, and that is fine. To get a probability you need an area, so use the cumulative value or the difference between two cumulative values.
A second error is feeding a value of x outside [0, 1]. The beta is undefined there, so x = 1.4 or x = -0.2 has no meaning. Rescale your quantity to a proportion first.
A third slip is mixing up the roles of \alpha and \beta during a Bayesian update. If your prior is \text{Beta}(\alpha, \beta) and you observe s successes in n trials, the posterior is \text{Beta}(\alpha + s, \beta + n - s). Add successes to \alpha and failures to \beta, not the reverse. Starting from a flat \text{Beta}(1, 1) and seeing 1 success in 5 trials gives \text{Beta}(2, 5), the demo curve.
How it connects to other distributions
The beta is the conjugate prior for the binomial distribution, and there is a tidy identity linking their cumulative functions: the probability that a Beta(k, n-k+1) variable exceeds p equals the binomial probability of at most k-1 successes in n trials with success probability p. That is why beta tail areas appear inside binomial confidence intervals.
The beta also relates to the gamma distribution: if X \sim \text{Gamma}(\alpha) and Y \sim \text{Gamma}(\beta) are independent, then X/(X+Y) follows Beta(\alpha, \beta). A rescaled beta shows up in the F distribution too. For a bell-shaped continuous variable that is not bounded, use the normal calculator instead, and for hypothesis testing quantiles see the t and chi-square tools.
Frequently asked questions
Why can the beta density be greater than 1?
Because density is height, not probability. For a continuous variable, probability is the area under the curve, and areas stay between 0 and 1 even when the curve rises above 1. The Beta(2, 5) density reaches about 1.55 near its peak.
What do alpha and beta mean intuitively?
Treat \alpha - 1 as a count of successes and \beta - 1 as a count of failures. Larger values sharpen the curve because more data pins down the proportion. Beta(2, 5) behaves like 1 success and 4 failures, so it favors low proportions.
How do I turn a beta into a Bayesian update?
Choose a prior Beta(\alpha, \beta), observe s successes in n trials, and the posterior is Beta(\alpha + s, \beta + n - s). No integration is needed because the beta is conjugate to the binomial.
What prior means "I know nothing"?
Beta(1, 1) is the flat uniform prior, giving every proportion equal density. Beta(0.5, 0.5), the Jeffreys prior, is another common choice; it is U shaped with more weight near 0 and 1.
Is the beta always skewed?
No. It is symmetric whenever \alpha = \beta, centered at 0.5. It skews right when \beta \gt \alpha and left when \alpha \gt \beta. Beta(2, 5) skews right, so its mean of 0.2857 sits above its mode of 0.2.