Confidence Interval Calculator

Calculate a confidence interval for a mean (t or z) or a proportion, with the margin of error, standard error and critical value.

Loading calculator...

Confidence interval in short
On this page

How to use the confidence interval calculator

1

Choose mean or proportion

Use mean for measurements such as heights or scores, and proportion for counts such as survey answers.

2

Enter your sample

For a mean: the sample mean, standard deviation and sample size. For a proportion: the number of successes and the sample size.

3

Pick a confidence level

95% is the most common. Higher levels give wider intervals.

4

Read the interval

You get the lower and upper bounds, the margin of error and every step.

How confidence intervals are calculated

Interval for a mean

CI = x̄ ± t* × s ÷ √n (sample standard deviation)

CI = x̄ ± z* × σ ÷ √n (known population σ)

The t* value uses n − 1 degrees of freedom. For large samples t* and z* are almost the same.

Interval for a proportion

p̂ = x ÷ n

CI = p̂ ± z* × √(p̂(1 − p̂) ÷ n)

This is the standard (Wald) interval. It works best when there are at least 10 successes and 10 failures.

Example 1: mean with a sample SD

Mean 100, SD 15, n = 36, 95% confidence.

  • Standard error 15 ÷ √36 = 2.5
  • t* (df = 35) 2.0301
  • Margin of error 5.0753
  • 95% CI 94.9247 to 105.0753

With a known population σ of 15 and z* = 1.96, the interval would be 95.1001 to 104.8999.

Example 2: a survey proportion

520 of 1,000 people said yes, 95% confidence.

  • p̂ 52%
  • Standard error 0.0158
  • Margin of error ± 3.1 points
  • 95% CI 48.9% to 55.1%

This is the “plus or minus 3 points” you see in poll results.

Common critical values (z*)

Two-sided confidence levels.

  • 90% 1.645
  • 95% 1.96
  • 99% 2.576

Higher confidence needs a larger critical value, so the interval gets wider.

Where a confidence interval calculator helps

Statistics homework

Check t and z intervals and see the margin of error worked out.

Surveys and polls

Report the margin of error for a percentage from a sample.

Research and lab work

Show how precise a measured average is.

Business testing

Judge whether a sample result is precise enough to act on.

Related tools

Get the mean and standard deviation of raw data with the standard deviation calculator. Look up any z critical value or p-value with the z-score calculator, and find percentiles with the percentile calculator.

Confidence interval calculator FAQ

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

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

Collect a larger sample, or accept a lower confidence level. Quadrupling the sample size roughly halves the margin of error.

It is half the width of the interval: the critical value times the standard error.

Enough for at least 10 successes and 10 failures. Below that the interval is only approximate.

80%, 85%, 90%, 95%, 98%, 99%, 99.5% and 99.9%.

Embed this calculator on your website

Free to use on any site. Copy the code below and paste it into an HTML block on your page. Please keep the credit link under the calculator.

Show the embed code

Works with WordPress, Wix, Squarespace, Webflow and most site builders that allow HTML. How embedding works.

Estimates, not advice

PureCalculate’s calculators give estimates for planning and education. They aren’t financial, tax or legal advice. Fees and tax rules change, so check the official source before making a decision. Spotted a mistake? Please tell us through the contact page.

Scroll to Top