SolveKit

Confidence Interval Calculator

Turn a sample mean into an interval estimate at 90, 95 or 99% confidence — or reverse-engineer the inputs behind a published interval.

By Dr. Priya Nair, science writer and former university physics lecturer · Updated

Confidence Interval Calculator

Enter any 4 known values — the others are solved as you type. Change units at any time.

Fill in the values you know.

How to use this calculator

Enter the sample mean, sample standard deviation, sample size and confidence level (95% is pre-filled). The calculator shows the critical value, standard error, margin of error and the lower and upper bounds. Change the confidence level to see how the interval widens at 99% or narrows at 90%.

For samples smaller than 30 the critical value comes from Student’s t distribution with n − 1 degrees of freedom, which widens the interval to account for the uncertainty in the estimated standard deviation; from n = 30 upwards the normal z value is used. A note under the sample size tells you which one applies. With n = 10 at 95% confidence, t = 2.262 instead of z = 1.960.

The reverse direction is useful when reading papers: enter a reported interval's lower and upper bounds with the sample size and confidence level to recover the mean, standard error and standard deviation — handy for meta-analysis or checking a result. You can also enter a desired margin of error with the SD to see the sample size required.

The formula

SE = s / √n
E = t₍₁₋α/₂, n−1₎ × SE for n < 30, otherwise E = z₍₁₋α/₂₎ × SE
CI = x̄ ± E
x̄
sample mean
s
standard deviation
n
sample size
CL
confidence level
z or t
critical value (t if n < 30, else z)
SE
standard error
E
margin of error
L
lower bound
U
upper bound

Worked example

A sample of 100 measurements has mean 50 and standard deviation 10. What is the 95% confidence interval for the population mean?

  1. Critical value z = Φ⁻¹(0.975) = 1.96.
  2. Standard error SE = 10 / √100 = 1.
  3. Margin E = 1.96 × 1 = 1.96, so the interval is 48.04 to 51.96.

We are 95% confident the population mean lies between 48.04 and 51.96.

Assumptions and limits

  • Below n = 30 the Student’s t critical value with n − 1 degrees of freedom is used; at n ≥ 30 the normal z value (the difference is under 4% at n = 30). If the population SD is known exactly, a z interval is appropriate at any n.
  • Observations are independent and the sampling distribution of the mean is approximately normal.

Frequently asked questions

What does a 95% confidence interval mean?

If the study were repeated many times, about 95% of the intervals computed this way would contain the true population mean. It is not a 95% probability for this particular interval.

Why does a larger sample give a narrower interval?

The standard error shrinks with √n. Quadrupling the sample size halves the margin of error.

What z-value goes with 99% confidence?

2.576. For 90% it is 1.645, and for 95% it is 1.960.

When should I use t instead of z?

When the standard deviation is estimated from a small sample. The t distribution has heavier tails, so the critical value is larger: 2.262 for n = 10 and 2.045 for n = 30 at 95% confidence, versus 1.960 for z.

Sources

Related calculators

More in Statistics calculators.