Confidence Interval Calculator
The range a population mean is likely to fall in, using the t-distribution for small samples.
Last updated
Your details
Result
- 95% confidence interval
- 66.5583 to 70.4417
- Margin of error
- ± 1.94171
- Standard error
- 0.949386
- Critical t (29 df)
- 2.04523
- Interval width
- 3.88342
s ÷ √n
Quadrupling the sample halves this
30 observations, mean 68.5…
CI = x̄ ± t × (s ÷ √n)
s ÷ √n = 5.2 ÷ √30 = 0.949386
t(29) at 95% = 2.04523
2.04523 × 0.949386 = 1.94171
66.5583 to 70.4417
Formula — written step by step
30 measurements, mean 68.5, SD 5.2…
CI = x̄ ± t × (s ÷ √n)
s ÷ √n = 5.2 ÷ √30 = 0.949386
t(29) at 95% = 2.04523
2.04523 × 0.949386 = 1.941712
66.5583 to 70.4417
x̄ is the sample mean, s the sample standard deviation and n the sample size. The t value comes from n − 1 degrees of freedom, and is a little wider than the equivalent z because the standard deviation was itself estimated.
A worked example
Why the sample size dominates
- Mean
- 68.5
- Standard deviation
- 5.2
- Confidence
- 95%
- n = 30: ± 2.045 × 0.9494 = ± 1.942
- n = 120: ± 1.980 × 0.4747 = ± 0.940
- n = 480: ± 1.965 × 0.2374 = ± 0.466
- Each step quadruples n
Quadrupling the sample halves the interval
Precision improves with the square root of the sample size, so buying twice the accuracy costs four times the data. This is the single most important fact for anyone planning a study — and the reason very precise estimates are expensive.
How to use this calculator
- Enter the sample mean, the sample standard deviation and how many observations you have.
- Leave the critical value on the t-distribution unless you genuinely know the population standard deviation, which is rare.
- Read the interval as a range for the population mean, not for individual values.
- A higher confidence level always produces a wider interval — certainty and precision trade against each other.
What a confidence interval says
A 95% confidence interval is a range computed by a procedure that, repeated across many samples, would contain the true population mean 95% of the time. It expresses how precisely the sample pins down the population value.
The careful wording matters. The interval does not say there is a 95% probability the true mean lies inside this particular range — the true mean is a fixed number, either in or out. The 95% describes the reliability of the method across repetitions, not the odds for one result.
Why t rather than z
The classical formula uses z and assumes the population standard deviation is known. In practice it almost never is, and the sample standard deviation is used instead — which adds a second source of uncertainty the z-based interval ignores.
The t-distribution accounts for it with heavier tails, giving a slightly wider and more honest interval. The effect shrinks as the sample grows: at 30 observations t is 2.042 against z at 1.960, and by several hundred they are practically identical. With fewer than about 30, using z understates the uncertainty noticeably.
Precision costs data
The width of the interval is governed by the standard error, s ÷ √n. Because n sits under a square root, halving the interval requires four times the sample, and cutting it to a tenth requires a hundred times.
This is why national polls sit around a thousand respondents. That gives roughly a three-point margin; getting to one and a half points would need four thousand, and to under one point, more than ten thousand. The extra precision rarely changes any decision the poll informs.
Formula & methodology
What this calculator assumes
- A 95% interval is produced by a procedure that would contain the true mean in 95% of repeated samples. It does not mean this particular interval has a 95% chance of containing it.
- Uses t rather than z because the standard deviation is estimated from the sample. With z the interval is too narrow, noticeably so below about 30 observations.
- Assumes the sample is random and the underlying distribution roughly normal, or the sample large enough for the central limit theorem to apply.
- It is an interval for the population mean, not a range containing 95% of the data.
Sources
Critical values by confidence level
| Confidence | z | t (df = 10) | t (df = 30) |
|---|---|---|---|
| 80% | 1.2816 | 1.3722 | 1.3104 |
| 90% | 1.6449 | 1.8125 | 1.6973 |
| 95% | 1.9600 | 2.2281 | 2.0423 |
| 99% | 2.5758 | 3.1693 | 2.7500 |
The t values converge on the z values as the sample grows. By about 30 observations the difference is small; below 10 it is substantial, which is why using z with a small sample understates the uncertainty.
Frequently asked questions
Does a 95% interval mean 95% of my data falls inside it?
No. It is a range for the population mean, not for individual observations. The range containing 95% of the data is a prediction interval, and it is far wider.
Should I use t or z?
Use t unless you genuinely know the population standard deviation rather than estimating it from your sample. With a large sample the two agree closely, so t is never the wrong choice.
What if my data is not normal?
For samples above roughly 30, the central limit theorem makes the interval for the mean reliable regardless. For small, visibly skewed samples, consider a bootstrap interval instead.
Why does 99% confidence give a wider interval?
Because more certainty demands more room. You can be very confident about a wide range or moderately confident about a narrow one; the data will not give you both.