Beta Distribution Calculator

JJ Ben-Joseph headshot JJ Ben-Joseph

Introduction: what this beta distribution calculator tells you

This beta distribution calculator evaluates a probability model that lives entirely on the unit interval from 0 to 1. That simple range is exactly why the beta distribution appears so often in real work: many quantities people care about are proportions, rates, or probabilities. A click-through rate, defect fraction, survival probability, vaccine uptake rate, and conversion rate are all naturally restricted to values between 0 and 1. The beta family is flexible enough to describe uncertainty that is roughly uniform, heavily concentrated near the middle, skewed toward one side, or even piled up near both boundaries. With just two positive shape parameters, a and b, it can represent a surprisingly wide variety of beliefs about an unknown proportion.

On this page, you enter the shape parameters a and b together with a point x in the interval [0, 1]. The calculator then reports the PDF, which is the density at that specific point; the CDF, which is the probability that a beta-distributed random variable is less than or equal to that point; and the distribution’s most common summary values, namely its mean, variance, and mode when that mode exists in the interior of the interval. The result is useful both for learning the distribution and for practical tasks such as checking a Bayesian prior or posterior before making a decision.

If you are new to the beta distribution, the fastest mental picture is this: a controls how strongly the mass is pulled toward 1, b controls how strongly it is pulled toward 0, and the total size of a + b influences how concentrated the curve becomes. When both parameters are 1, the distribution is flat. When they are equal and larger than 1, the curve is symmetric and centered. When one is larger than the other, the curve leans toward that side. When either parameter drops below 1, the distribution can spike at the corresponding boundary. That is not a bug; it is one of the signature behaviors of beta models.

To use the calculator, enter a and b as positive numbers, enter x as a proportion between 0 and 1 inclusive, and press Compute. The Copy result button appears after a successful calculation so you can save or paste the summary elsewhere. If your data are in percentages, remember to convert them first: for example, 35% should be entered as 0.35, not 35.

Formulas behind the calculator

For a > 0, b > 0, and 0 ≤ x ≤ 1, the beta distribution has the following density. This formula explains why the curve can change shape so dramatically as the parameters change: the powers of x and 1 − x tilt the mass toward one boundary or the other, while the beta function in the denominator rescales everything so the total area remains 1.

f(x;a,b) = xa-1 (1-x)b-1 B(a,b)

The normalizing constant B(a,b) is the beta function itself. It is what makes the total probability add up correctly over the whole interval.

B(a,b) = 01 ta-1 (1-t)b-1 dt

The cumulative distribution function, or CDF, measures accumulated probability from 0 up to the chosen point x. In other words, it tells you the chance that a beta-distributed random variable falls at or below that threshold.

F(x;a,b) = Ix(a,b)

The mean and variance describe the center and spread of the distribution. These two formulas are often the quickest way to get intuition about a parameter choice before looking at the full curve.

E[X] = aa+b Var(X) = ab a+b2 (a+b+1)

The mode is defined only when a > 1 and b > 1: a-1a+b-2. If either parameter is less than or equal to 1, the distribution may peak at a boundary instead of having a single interior peak. That is why calculators typically report the interior mode as undefined in those cases.

How to read the inputs and results

The three inputs each play a different role. The value a is the first shape parameter, b is the second shape parameter, and x is the location where you want to evaluate the model. The calculator assumes a > 0 and b > 0. The point x must lie between 0 and 1 inclusive because the beta distribution has no support outside that interval.

The returned PDF is a density, not a direct probability. That distinction matters because densities can be greater than 1 without violating any rule. A tall PDF simply means probability is packed tightly around that point. Actual probabilities come from areas under the curve. By contrast, the CDF is a true probability, so it always falls between 0 and 1. If you ask for the CDF at x = 0.4, you are asking for the probability that the random variable is at most 0.4.

The mean summarizes the average location of the distribution, the variance summarizes how spread out it is, and the mode identifies the most likely interior value when such a point exists. These summaries help you interpret the curve quickly. For instance, if two beta distributions share the same mean but one has much larger a + b, that one is usually more concentrated around the mean and therefore represents greater certainty.

A few parameter patterns are worth remembering. When a = b = 1, the beta distribution is uniform on [0, 1]. When a > b, the curve usually leans toward 1. When a < b, it leans toward 0. When both are greater than 1 and roughly equal, you get a smooth hump in the middle. When both are below 1, the shape often becomes U-shaped, with more mass near 0 and 1 than near the center. These patterns show up all the time in Bayesian work because prior beliefs often have exactly those kinds of shapes.

The compact table below is a useful mental check. It shows how the mean stays tied to a/(a+b) while the variance becomes smaller as the total parameter size grows. In plain language, larger parameter totals often mean the model is more confident about the underlying proportion.

Selected Beta(a, b) parameter sets and their mean and variance
a b Typical shape Mean Variance
1 1 Uniform 0.5 0.0833
2 5 Skewed toward 0 0.2857 0.0255
5 2 Skewed toward 1 0.7143 0.0255
2 2 Symmetric (bell-shaped) 0.5 0.05
0.5 0.5 U-shaped (boundary-heavy) 0.5 0.125

One practical reminder: if the PDF shown here is extremely large near 0 or 1, that can be perfectly valid. Beta densities may diverge at a boundary when one of the shape parameters is less than 1. Even then, the total probability is still finite because the spike is integrable. So if you see a boundary warning in the results, interpret it as a shape feature of the model rather than a failure of the calculation.

Worked example: Beta(2, 5) at x = 0.4

Suppose you want to evaluate Beta(2, 5) at x = 0.4. The first thing to notice is that a < b, so the distribution is tilted toward lower values. That already suggests a belief that the underlying proportion is usually closer to 0 than to 1.

The mean is 2 / (2 + 5) = 0.285714, which places the average well below 0.5. The variance is (2·5) / ((7²)·8) = 0.025510, which tells you the spread is moderate rather than huge. The PDF at x = 0.4 is the density height at that exact point, so it tells you how concentrated probability is around 0.4. The CDF at x = 0.4 is more directly interpretable: it is P(X ≤ 0.4), the accumulated probability up to that threshold.

In plain language, this example describes a proportion that is usually on the low side but can still take middle values. If you increase a while keeping b fixed, the mean moves right and the mass shifts toward 1. If you increase b while keeping a fixed, the mean moves left and the mass shifts toward 0. If you increase both together without changing their ratio much, the center stays similar but the distribution becomes more concentrated.

Bayesian updating, assumptions, and common pitfalls

The beta distribution is especially important in Bayesian statistics because it is conjugate to the Bernoulli and binomial models. If you start with a prior Beta(a, b) and then observe k successes in n trials, the posterior becomes Beta(a + k, b + n − k). This makes the parameter update simple and intuitive: successes add to a, failures add to b. That is why people often describe the parameters as prior pseudo-counts.

For example, imagine you begin with a neutral prior Beta(1, 1) for an unknown conversion rate. After observing 6 conversions in 20 trials, the posterior becomes Beta(7, 15). The posterior mean is 7 / 22 = 0.31818, which is a smoothed estimate of the rate. If you then use this calculator to evaluate the CDF at x = 0.30, you obtain the posterior probability that the true conversion rate is at most 30%. That type of probability statement is often more informative for decisions than quoting a single estimate alone.

The calculator assumes valid numerical inputs and evaluates the CDF numerically in the browser. For everyday values, this is accurate and fast. Still, like most browser-based tools, it is not intended to replace a specialized high-precision statistics package for extreme parameter sizes or delicate tail-probability work. When a or b becomes very large, or when x is extremely close to 0 or 1, floating-point limits can influence the displayed values.

A few common mistakes are easy to avoid. First, do not enter percentages directly; convert them to proportions. Second, do not use a = 0 or b = 0; the beta distribution requires strictly positive parameters. Third, do not interpret a PDF value greater than 1 as a probability greater than 100%. And finally, if the mode is reported as undefined, remember that this means the interior mode formula does not apply. The distribution may instead be monotone or may place its highest density at a boundary.

If you are choosing prior parameters from a target mean m and an informal prior strength s, a common shortcut is to set a = m·s and b = (1 − m)·s. For instance, if you think a conversion rate is around 0.25 and want that prior belief to carry roughly the weight of 16 observations, you would choose a = 4 and b = 12. This calculator then lets you inspect how concentrated that prior is and how much probability lies below or above a business-relevant threshold.

Frequently asked questions

What is the beta distribution used for? It is used for quantities restricted to [0, 1], especially probabilities, rates, and proportions. In Bayesian analysis it is the standard conjugate prior for binomial proportions.

Can the beta distribution take values outside 0 and 1? No. If your variable lives on another interval, you usually rescale it first before using a beta model.

Why does the PDF sometimes display infinity at a boundary? If a < 1, the density can diverge at 0; if b < 1, it can diverge at 1. The distribution is still valid because the total area under the curve remains 1.

What does it mean when the mode is undefined? The usual interior mode formula works only when a > 1 and b > 1. If either parameter is less than or equal to 1, the highest density may occur at a boundary or the shape may not have one interior peak.

How do I pick a and b for a prior? A simple way is to choose a prior mean and an effective sample size. Then set a = m·s and b = (1 − m)·s. Larger s creates a tighter prior around the same mean.

Related calculators

If you are exploring nearby concepts, you may also want the beta function calculator, the binomial distribution calculator, and the gamma distribution calculator.

Must be greater than 0. Smaller values (< 1) can create a boundary spike near x = 0.

Must be greater than 0. Smaller values (< 1) can create a boundary spike near x = 1.

x is the evaluation point for the PDF and the upper limit for the CDF.

Enter parameters to get PDF, CDF, mean, and variance.

Ready.

Mini-game: Match the beta curve

This optional arcade-style mini-game is separate from the calculator result above. It turns the same ideas into a quick shape-matching challenge: you tune a and b to make your curve overlap the glowing target beta distribution before the timer runs out. It is a fast way to build intuition for skew, concentration, and boundary-heavy beta shapes.

Score0
Time75.0s
Round1
Streak0
Match0%
Lock0%

Click to play: Match the beta curve

A glowing target beta curve appears on the unit interval. Your cyan curve starts elsewhere. Tap A−, A+, B−, and B+ or use the arrow keys to tune the shape until your match rises above the lock threshold. Hold it there for a moment to clear the round. Later waves introduce sharper peaks and boundary-heavy targets.

Best score: 0

Takeaway: when a grows relative to b, the mass shifts toward 1; when b grows relative to a, it shifts toward 0.

Current curve: a = 1.00, b = 1.00

Goal: overlap the glowing target. Increasing both parameters usually narrows the curve while the ratio between them controls the mean.

Embed this calculator

Copy and paste the HTML below to add the Beta Distribution Calculator – PDF, CDF, Mean, Variance & Mode to your website.