Confidence Interval Calculator

A free tool by DeepRit, a Google Ads agency that does PPC and nothing else. We build and run Google Ads accounts so every click is accounted for. Book a free audit call

Free confidence interval calculator for a mean (t or z) or a proportion (Wald and Wilson), with the margin of error and critical value at any level.

Lower bound
0
Upper bound
0
Margin of error
0
Standard error
0
Critical value
0

Free, no sign-up. Runs in your browser: nothing you type is uploaded or saved.

How to use the confidence interval calculator

  1. Choose what the interval is for: a mean (an average, like a customer rating or a weight) or a proportion (a percentage, like the share of people who said yes).
  2. Set the confidence level, usually 95%. Any level between 0% and 100% works.
  3. Enter your sample figures:
    • For a mean: the sample mean, the standard deviation, the sample size, and whether the standard deviation comes from your sample (the usual case) or is known for the whole population.
    • For a proportion: the number of successes (yes answers) and the sample size.
  4. Read the interval. The confidence interval calculator shows the lower and upper bounds, the margin of error, the standard error and the critical value it used.

What a confidence interval is

A sample gives you an estimate, but a different sample would give a slightly different one. A confidence interval puts a range around your estimate that reflects that uncertainty.

A 95% confidence interval of 45.9 to 54.1 means: if you repeated the same sampling many times, about 95% of the intervals built this way would contain the true population value. In everyday terms, you can be fairly confident the true value is somewhere in that range.

Strictly, it doesn't mean "there's a 95% chance the true mean is in this particular interval": the true mean is fixed, and the interval either contains it or doesn't. But the practical reading, "the plausible range for the true value", is how it's used.

Confidence interval for a mean

Interval = mean ± critical value × (SD ÷ √n)

The part in brackets is the standard error. The critical value depends on the confidence level and on which distribution is used.

With a sample standard deviation (most cases), use t. When the standard deviation is calculated from the same sample, there's extra uncertainty, and the t distribution accounts for it. Its critical value depends on the degrees of freedom (n − 1) and is larger than z for small samples.

With a known population standard deviation, use z. This is rare outside textbooks and quality control with long-established processes.

For a sample of 25 with mean 50 and standard deviation 10, at 95%:

  • Standard error = 10 ÷ √25 = 2
  • t critical value for 24 degrees of freedom = 2.0639
  • Margin of error = 2.0639 × 2 = 4.128
  • Interval: 45.87 to 54.13

If σ = 10 were known for the population, z = 1.96 and the margin would be 3.92, a slightly narrower interval.

The confidence interval calculator computes the t distribution exactly (with the incomplete beta function), so you don't need a t-table, and any sample size or level works.

Confidence interval for a proportion

Interval = p ± z × √(p(1 − p) ÷ n)

where p is the sample proportion. If 520 of 1,000 people say yes, p = 0.52:

  • Standard error = √(0.52 × 0.48 ÷ 1,000) = 0.0158
  • Margin at 95% = 1.96 × 0.0158 = 0.031, or 3.1 percentage points
  • Interval: 48.9% to 55.1%

This is the "margin of error" quoted with opinion polls.

The simple formula above (the Wald interval) is standard but can be poor for small samples or proportions near 0% or 100%. The confidence interval calculator also shows the Wilson score interval, which statisticians recommend in those cases, and warns you when you should use it (fewer than 10 successes or failures).

Common confidence levels

Level z critical value
80% 1.2816
90% 1.6449
95% 1.9600
98% 2.3263
99% 2.5758
99.9% 3.2905

Higher confidence means a wider interval. There's always a trade-off: 99% confidence gives a range you can be surer of, but it's less precise.

What makes the interval narrower

  • A bigger sample. The margin shrinks with √n, so to halve it you need four times the sample.
  • Less variation in the data. A smaller standard deviation gives a tighter interval.
  • A lower confidence level, at the cost of being less sure.

To plan how many responses you need for a target margin of error, use the sample size calculator.

Using confidence intervals well

  • Report the interval, not just the estimate. "4.3 stars (95% CI 3.95 to 4.65)" is far more honest than "4.3 stars".
  • Overlapping intervals don't prove "no difference", and non-overlap is a stricter test than significance. To compare two groups properly, test the difference, as the A/B test calculator does.
  • The sample must be random or at least representative. A confidence interval can't fix a biased sample, such as a survey only of your happiest customers.
  • Check the assumptions. For means, the t interval works well when data is roughly normal or the sample is large (30+ is a common rule of thumb).

Tips

  • If you have raw data, get the mean and standard deviation from the standard deviation calculator first (use the sample SD).
  • For a proportion, enter counts, not percentages: 132 out of 400, not 33%.
  • Keep a few extra decimals when you report the critical value and standard error, so others can check your working.

Privacy and accuracy

Your figures stay in your browser; nothing is uploaded. The confidence interval calculator uses exact normal and Student's t quantiles, accurate to many decimal places, with no AI and no lookup tables, so the same inputs always give the same, correct result. Researchers, students, marketers and analysts use it free on any device.

Confidence intervals for differences

Often the real question is whether two groups differ: two versions of a web page, two teaching methods, two suppliers. You can build a confidence interval for the difference. If the interval for "version B minus version A" excludes zero, the difference is statistically significant at that level. The A/B test calculator does this for conversion rates.

Confidence interval vs prediction interval

A confidence interval describes where the average is likely to be. A prediction interval describes where a single new value is likely to fall, and it's always much wider. With a mean rating of 4.3 and a 95% confidence interval of 3.95 to 4.65, individual customers will still give 2s and 5s. Mixing the two up is a common mistake in reports.

Reporting a confidence interval

A clear format is: estimate, then the interval and level in brackets. For example: "Average rating 4.3 (95% CI 3.95 to 4.65, n = 40)." For proportions: "33% would definitely recommend us (95% CI 28.4% to 37.6%, n = 400)." Including the sample size lets readers judge the precision for themselves.

Quick reference

  • Point estimate: your best single guess (the sample mean or proportion).
  • Standard error: how much the estimate would vary between samples.
  • Critical value: the z or t number for your confidence level (1.96 for 95% with z).
  • Margin of error: critical value × standard error.
  • Degrees of freedom: n − 1 for a mean's t interval.

All five appear in the confidence interval calculator's results.

A worked example

A restaurant asks 40 customers to rate their meal from 1 to 5. The average is 4.3 with a standard deviation of 1.1. The owner wants to know how reliable that 4.3 is. She enters mean 4.3, SD 1.1, n 40 and 95% into the confidence interval calculator, with the standard deviation marked as coming from the sample.

The calculator uses t = 2.0227 with 39 degrees of freedom. The standard error is 0.174, so the margin of error is ±0.35, and the interval is 3.95 to 4.65. The true average rating across all customers is very likely between about 4 and 4.6.

She also asked whether people would recommend the restaurant: 132 of 400 survey replies said "definitely". In proportion mode, that's 33%, with a 95% interval of 28.4% to 37.6% (Wilson: 28.6% to 37.7%). She now quotes "about a third of customers, give or take 5 points" in her report.

Need more customers from Google?

This tool is free and runs in your browser. If your business also needs more leads or sales, Google Ads is where people search with their wallet out. DeepRit is a Google Ads agency that does PPC and nothing else: we build the campaigns, block the searches that waste money, write the ads, set up conversion tracking and send you a short report every week. Request a free PPC audit and we will show you, in dollars, what we would fix first.

Frequently asked questions

How do I calculate a 95% confidence interval?

For a mean: mean ± t × SD ÷ √n, where t comes from the t distribution with n − 1 degrees of freedom. For a proportion: p ± 1.96 × √(p(1 − p) ÷ n). The confidence interval calculator does both.

Should I use t or z?

Use t when the standard deviation comes from your sample, which is almost always. Use z only when the population standard deviation is truly known.

What is the margin of error?

Half the width of the confidence interval: how far the estimate could reasonably be from the true value.

Why is my interval so wide?

The sample is small or the data varies a lot. A bigger sample narrows it.

What's the Wilson interval?

A more accurate confidence interval for proportions, especially with small samples or percentages near 0% or 100%.

Is the confidence interval calculator free?

Yes, completely free, with no sign-up.

Free PPC audit

See where your ad budget leaks.

We look at your Google Ads account before the call, then walk you through what we'd fix first, in dollars. No obligation, no hard sell.

Book a free audit call 30-minute call · Free · The audit is yours to keep