How to use the confidence interval calculator
- Choose whether you're estimating a mean (an average, like test scores or weights) or a proportion (a share, like the percentage of voters who agree).
- For a mean, enter the sample mean, standard deviation and sample size, or switch to Raw data and paste your values. For a proportion, enter the number of successes and the sample size.
- Pick a confidence level. 95% is the usual choice; 90% gives a narrower interval and 99% a wider one.
- Click Calculate interval to see the interval, the margin of error and each step of the working.
- Download the chart if you need it for a report or assignment.
Confidence interval formulas
Every confidence interval has the same shape: a point estimate, plus and minus a margin of error. The margin of error is a critical value times the standard error.
Mean, σ unknown: x ± t* × sn
Mean, σ known: x ± z* × σn
Proportion: p ± z* × p(1 − p)n
- x
- The sample mean
- p
- The sample proportion: successes divided by the sample size, x / n
- s
- The sample standard deviation
- σ
- The population standard deviation, when it is known
- n
- The sample size
- t*
- The critical value from the t distribution with n − 1 degrees of freedom, leaving (1 − confidence) / 2 in each tail
- z*
- The critical value from the standard normal distribution, e.g. 1.960 for 95%
Critical values for common confidence levels
| Confidence level | z* | t* (df = 10) | t* (df = 30) |
|---|---|---|---|
| 80% | 1.282 | 1.372 | 1.310 |
| 90% | 1.645 | 1.812 | 1.697 |
| 95% | 1.960 | 2.228 | 2.042 |
| 98% | 2.326 | 2.764 | 2.457 |
| 99% | 2.576 | 3.169 | 2.750 |
As the degrees of freedom grow, t* gets closer to z*. The calculator works out the exact value for your sample size.
Worked example
A teacher samples 30 students and finds a mean exam score of 72.4 with a standard deviation of 8.5. What is the 95% confidence interval for the mean score of all students?
-
σ is unknown, so use t with n − 1 degrees of freedom
df = 30 − 1 = 29
-
Find the critical value that leaves 2.5% in each tail
t* = t0.975, 29 = 2.0452
-
Standard error of the mean
SE = 8.530 = 1.5519
-
Margin of error
ME = 2.0452 × 1.5519 = 3.1740
-
Add and subtract it from the mean
72.4 ± 3.1740 = 69.23 to 75.57
What it means: the teacher can be 95% confident that the average score for all students is between about 69.2 and 75.6. The interval is fairly narrow because 30 students is a reasonable sample and the scores don't vary wildly.
How to interpret a confidence interval
A confidence interval gives a range of plausible values for a population value you can't measure directly. Report it alongside the point estimate, for example "mean 72.4, 95% CI 69.2 to 75.6".
- The confidence level is about the method. Repeat the study many times and about 95% of the 95% intervals would capture the true value. It is not a 95% chance that this particular interval is right.
- Width tells you precision. A narrow interval means a precise estimate. A wide one means you need more data before drawing firm conclusions.
- Higher confidence means a wider interval. A 99% interval is wider than a 95% interval from the same data, because it has to capture the true value more often.
- It does not describe individual values. A confidence interval for the mean says where the average is likely to be, not where 95% of individual observations fall.
Confidence intervals and hypothesis tests are two views of the same evidence. If a reference value falls outside a 95% interval, a two-tailed t-test against that value would be significant at α = 0.05.