How to use it
Three modes. Mean from data takes your raw numbers and derives everything. Mean from summary is for when you already have x̄, s and n — from a paper, a report or another tool. Proportion handles counts: successes out of a total, for survey results, conversion rates and pass rates.
The working table lists every step in order, with the arithmetic spelled out, so the result can be reproduced by hand or checked against coursework.
What a confidence interval actually says
A sample mean is a single number. Collect a different sample and you would get a different one. A confidence interval quantifies that instability: it is a range of values that the procedure would capture the true population figure within, a stated percentage of the time.
Both have the same shape: a point estimate, plus or minus a critical value times a standard error. The standard error measures how much the estimate would bounce around across repeated samples; the critical value scales it to the confidence level you asked for.
A worked example
Twelve measurements with a mean of 23.75 and a sample standard deviation of 8.32, at 95% confidence.
- Standard error: 8.32 ÷ √12 = 8.32 ÷ 3.4641 = 2.4018
- Degrees of freedom: n − 1 = 11
- Critical value: t at 95% with df = 11 is 2.201
- Margin of error: 2.201 × 2.4018 = 5.286
- Interval: 23.75 ± 5.286 = 18.46 to 29.04
Note how wide that is relative to the estimate — a range of nearly eleven units around a mean of 23.75. Twelve observations simply do not pin down a mean tightly. Had n been 100 with the same standard deviation, the standard error would fall to 0.832, the critical value to about 1.984, and the interval would narrow to 22.10–25.40.
t or z — which distribution?
Use t in almost every real situation. It is the correct distribution when the population standard deviation is unknown and estimated from the same sample, which is virtually always the case. Its heavier tails widen the interval to account for that extra uncertainty.
Use z only when the population standard deviation is genuinely known in advance — rare outside textbook problems — or for proportions, where the standard error is derived from p̂ itself rather than from a separate variance estimate.
The two converge as n grows. At df = 10 the 95% t value is 2.228 against z's 1.960 — a 14% wider interval. At df = 30 it is 2.042, about 4% wider. Beyond df = 120 the difference is under 1% and immaterial.
Critical value reference
| df | 90% | 95% | 98% | 99% |
|---|---|---|---|---|
| 5 | 2.015 | 2.571 | 3.365 | 4.032 |
| 10 | 1.812 | 2.228 | 2.764 | 3.169 |
| 15 | 1.753 | 2.131 | 2.602 | 2.947 |
| 20 | 1.725 | 2.086 | 2.528 | 2.845 |
| 30 | 1.697 | 2.042 | 2.457 | 2.750 |
| 60 | 1.671 | 2.000 | 2.390 | 2.660 |
| ∞ (z) | 1.645 | 1.960 | 2.326 | 2.576 |
This tool uses exact tabulated t values for df up to 30, linear interpolation between the standard anchors of 30, 40, 60 and 120, and the normal critical value beyond that. On any df above about 40 the interpolation error is smaller than the rounding in the fourth decimal place.
What controls the width
- Sample size. Width scales with 1 ÷ √n, so to halve the interval you must quadruple the sample. This is the fundamental economics of survey design: precision gets expensive fast.
- Variability. A larger standard deviation means a wider interval. Nothing can be done about this except measuring more precisely or stratifying the sample.
- Confidence level. Going from 95% to 99% widens the interval by roughly a third. Higher confidence is not free — you buy it with precision. This is why 95% became the default: it is a reasonable compromise, not a law of nature.
Conditions for validity
For a mean: observations must be independent, and either the underlying population is roughly normal, or n is large enough (conventionally 30 or more) for the central limit theorem to make the sampling distribution of the mean approximately normal regardless. Strong skew or extreme outliers at small n break the interval.
For a proportion: observations independent, and both np̂ and n(1 − p̂) at least 10. The calculator checks this and warns you when it fails. Near p = 0 or p = 1 the normal approximation performs badly and can even produce bounds outside 0–1; use the Wilson score interval or an exact Clopper–Pearson interval instead.
Frequently asked questions
Does a 95% interval mean 95% of my data falls in it?
Why is my interval so wide?
Can I use a 90% interval to get a narrower result?
Two intervals overlap. Are the groups the same?
What if my data is badly skewed?
How do I choose a sample size in advance?
Is my data stored?
Next steps
The standard error this page uses comes straight from the sample standard deviation — the standard deviation calculator shows how it is built, deviation by deviation. The critical z values here (1.645, 1.960, 2.326, 2.576) are the same ones behind the z-score calculator. Before trusting an interval for the mean, check whether the mean is a sensible centre at all using the descriptive summary.