Bayesian Credible Interval Calculator

Calculate Bayesian credible intervals for a proportion using observed data. Enter your sample size (N), number of successes (k), and credible interval level — along with optional prior parameters (alpha, beta) for an informative prior. You get back the lower and upper credible bounds, the posterior mean, and the point estimate, with a visual breakdown of the posterior Beta distribution.

Total number of items examined in your sample.

Number of items exhibiting the feature of interest.

%

Probability mass contained within the credible interval (e.g. 95).

Equal-tails splits alpha equally; HDI gives the narrowest interval.

Shape parameter α of the Beta prior. Use α=1, β=1 for a flat (non-informative) prior.

Shape parameter β of the Beta prior. Use α=1, β=1 for a flat (non-informative) prior.

Results

Credible Interval

--

Lower Bound

--

Upper Bound

--

Posterior Mean

--

Point Estimate (k/N)

--

Interval Width

--

Posterior α

--

Posterior β

--

Posterior Beta Distribution

Results Table

Frequently Asked Questions

What is a Bayesian credible interval?

A Bayesian credible interval is a range of values that contains the true parameter with a specified posterior probability. For example, a 95% credible interval means there is a 95% probability that the true proportion lies within that range, given the observed data and your prior beliefs. This is a direct probabilistic statement, unlike the frequentist confidence interval.

How is a Bayesian credible interval different from a frequentist confidence interval?

A frequentist 95% confidence interval means that if you repeated the experiment many times, 95% of those intervals would contain the true parameter — it does not mean there is a 95% chance the true value is in any single interval. A Bayesian credible interval, by contrast, gives a direct probability statement: there is a 95% posterior probability the parameter lies in the interval, given your data and prior.

What prior should I use if I have no prior knowledge?

Use a flat (non-informative) prior by setting Prior Alpha (α) = 1 and Prior Beta (β) = 1. This is a uniform Beta(1,1) distribution, which assigns equal probability to all possible proportions between 0 and 1. It is often called Bayes' ignorance prior and lets the data dominate the posterior.

What if I'm not so ignorant — how do I use an informative prior?

If you have prior knowledge or results from previous studies, set α and β to reflect that belief. For instance, if you previously observed 30 successes in 100 trials, you could set α = 31 and β = 71 (adding 1 for the Beta parameterization). Higher α and β values mean a stronger, more concentrated prior that takes more data to shift.

What is the posterior distribution used here?

When the prior is Beta(α, β) and you observe k successes in N trials, the posterior distribution is Beta(α + k, β + N − k). The Beta distribution is the conjugate prior for the Binomial likelihood, which makes the math tractable and the posterior easy to compute and interpret.

What is the difference between an Equal-Tails Interval (ETI) and a Highest Density Interval (HDI)?

An ETI (equal-tails interval) places equal probability mass in both tails — for a 95% interval, 2.5% is in each tail. An HDI is the shortest interval that contains the specified probability mass. For symmetric distributions these are nearly identical, but for skewed posteriors the HDI is narrower and often more informative.

What is the point estimate shown in the results?

The point estimate (k/N) is the maximum-likelihood estimate of the proportion — simply the fraction of successes in your sample. It is shown alongside the posterior mean, which incorporates your prior. For a non-informative prior with large N, these two values converge closely.

Can this calculator be used for A/B testing or conversion rate analysis?

Yes. Enter the total number of visitors or impressions as N and the number of conversions or clicks as k. The resulting credible interval gives you a probabilistic range for the true conversion rate. For A/B testing, you would run this separately for each variant and compare the resulting intervals.

More Statistics Tools