Free statistics tool

Free Confidence Interval Calculator

Get the 90%, 95% or 99% confidence interval for a sample mean or for a proportion, such as a conversion rate. Enter your numbers and the interval, margin of error and critical value update as you type.

Live calculator

Calculate a confidence interval

95% confidence interval

46.8018 to 53.1982

50 ± 3.1982 (t = 2.023, 39 degrees of freedom)

What is a confidence interval?

A confidence interval is a range of values that is likely to contain the true value you are estimating, such as the average order value of all customers or the true conversion rate of a page. You only see a sample, so your estimate has some uncertainty. The interval shows how big that uncertainty is.

The confidence level says how often the method catches the true value. A 95% interval uses a method that contains the true value in about 95 out of 100 repeated samples. A 99% interval is wider, because it has to be right more often.

Confidence interval for a mean

The formula is: mean ± t × (s / √n).

Here s is the sample standard deviation, n is the sample size, and t is the critical value of Student's t distribution with n - 1 degrees of freedom. Example: a sample of 40 orders has a mean of $50 and a standard deviation of $10. At 95% confidence t is about 2.023, so the margin of error is 2.023 × 10 / √40 ≈ 3.20. The interval is about $46.80 to $53.20.

With small samples the t value is much larger than 1.96, which is why using the normal z value for a small sample gives an interval that is too narrow.

Confidence interval for a proportion

For a proportion, such as 35 conversions out of 1,000 visitors, this calculator uses the Wilson score interval. The simpler “p ± z × √(p(1 - p) / n)” formula can give limits below 0% or above 100% and is too narrow when the rate is close to 0, which is common for conversion rates. Wilson does not have those problems.

Example: 35 conversions from 1,000 visitors is a 3.5% conversion rate. The 95% Wilson interval is about 2.53% to 4.83%.

Confidence intervals in A/B testing

In an A/B test each variant has its own conversion rate and its own interval. When the intervals overlap a lot, the test has not told the variants apart yet. To decide a test, compare the two rates directly with a significance calculator, and plan the traffic you need up front with the sample size calculator.

FAQ

How do you calculate a 95% confidence interval?

For a mean: mean ± t × (standard deviation / √n), where t is the 95% critical value of Student's t with n - 1 degrees of freedom. With a large sample t is close to 1.96. For a proportion, this calculator uses the Wilson score interval with z = 1.96.

What does a 95% confidence interval mean?

If you repeated the same sampling many times and built an interval each time, about 95% of those intervals would contain the true value. It does not mean there is a 95% chance that this one interval contains it.

Why does a bigger sample give a narrower interval?

The margin of error shrinks with the square root of the sample size. Four times as many observations cut the margin of error roughly in half.

Run the test, not the math

PageDuel runs your A/B tests and tracks conversions and revenue per variant, with the statistics done for you.

14-day free trial · No credit card required