Confidence Interval Calculator
t-interval for the mean with margin of error, critical t, and standard error.
What it does
A confidence interval estimates a population mean from a sample, honestly paired with its uncertainty. The t-based version used here needs just three numbers: the sample mean, the sample standard deviation, and the sample size.
The construction is simple. The standard error of the mean is s / sqrt(n). Multiply it by the critical t value from the t distribution with n - 1 degrees of freedom, and you get the margin of error; the interval is the mean plus or minus that margin.
This is the method in NIST's engineering statistics handbook and OpenStax's statistics text: use t whenever the population standard deviation is unknown, which in practice is nearly always. With very large n the t* value converges to the familiar z of 1.96 at 95 %.
Interpretation matters as much as arithmetic. 95 % confidence describes the procedure: if you repeated the study forever, 95 % of the intervals built this way would contain the true mean. It is not a 95 % probability for one fixed interval.
How to use
- Enter the sample mean.
- Enter the sample standard deviation.
- Enter the sample size.
- Pick 90, 95, or 99 % confidence.
- Read the interval first.
- Read the margin, critical t, and standard error.
Formula
- x̄
- Sample mean.
- s
- Sample standard deviation.
- n
- Sample size.
- t*
- Critical value from the t distribution, n - 1 degrees of freedom.
- SE
- Standard error of the mean, s / sqrt(n).
The t interval assumes roughly normal data or a large enough n for the central limit theorem, independent observations, and a sample standard deviation (not a known population sigma). With known sigma or enormous n, swap t* for the z value: 1.645 at 90 %, 1.960 at 95 %, 2.576 at 99 %.
Worked example
Example: mean 100, SD 15, n 25, 95 %
Defaults: sample mean 100, standard deviation 15, sample size 25, 95 % confidence.
- SE = 15 / sqrt(25) = 3.00.
- Degrees of freedom 24; t* = 2.064.
- Margin = 2.064 x 3.00 = 6.19.
- Interval: 100 ± 6.19, or 93.81 to 106.19.
- Tool shows 93.81 to 106.19, margin 6.19, t* 2.064, SE 3.00.
Reference table
| Sample size | SE | t* | Margin | Interval |
|---|---|---|---|---|
| 10 | 4.743 | 2.262 | 10.73 | 89.27 to 110.73 |
| 25 | 3.000 | 2.064 | 6.19 | 93.81 to 106.19 |
| 50 | 2.121 | 2.010 | 4.26 | 95.74 to 104.26 |
| 100 | 1.500 | 1.984 | 2.98 | 97.02 to 102.98 |
| 400 | 0.750 | 1.966 | 1.47 | 98.53 to 101.47 |
Limits
- Assumes roughly normal data or large n; heavy skew and outliers need bigger samples or bootstrap methods.
- Observations should be independent; clusters, repeated measures, or weights break the standard error.
- Uses the sample SD; a genuinely known population sigma calls for a z interval.
- One interval for one mean; comparing groups or scanning many means needs multiplicity corrections.
Common mistakes
- Saying this interval has a 95 % chance of containing the true mean.
- Using z = 1.96 for small samples instead of t*.
- Confusing the standard deviation with the standard error.
- Treating a wide interval as a bad result; it is honest uncertainty from the data given.
- Reading non-overlapping intervals as a formal significance test.
Try it yourself
Quick checks. Answers sit tucked under each question.
Mean 50, SD 10, n 100, 95 %?
SE 1.00, t* 1.984, margin 1.98, interval 48.02 to 51.98.
Mean 100, SD 15, n 25 at 99 %?
t* 2.797, margin 8.39, interval 91.61 to 108.39.
Back to 95 % with n 400?
Margin 1.47, interval 98.53 to 101.47.
Questions
What does 95 % confidence mean?
The procedure captures the true mean in 95 % of repeated studies. One computed interval is either in or out; it does not carry a 95 % chance.
When do I use z instead of t?
Only when the population SD is truly known or n is enormous; the tables meet around n of several hundred. Otherwise t is the correct default.
Why does more data tighten the interval?
Standard error shrinks with the square root of n. Quadrupling n roughly halves the margin, which is why n 100 shows 2.98 against 6.19 at n 25.
What changes at 99 %?
t* grows from 2.064 to 2.797 at 24 degrees of freedom, so the same data earns a wider 8.39 margin. Confidence and precision trade off.
Does this assume normal data?
Approximately. t intervals tolerate mild non-normality, but strong skew or outliers call for larger samples or resampling methods.
Can the interval be huge?
Yes, and that is information: small n plus large SD honestly reports wide uncertainty. The fix is more or better data, not a narrower formula.
Sources
- NIST Engineering Statistics Handbook: Confidence Interval for the Mean
- NIST Engineering Statistics Handbook: Measures of Confidence
- OpenStax Introductory Statistics 2e: A Single Population Mean