Confidence Interval for a Mean Calculator
A sample mean on its own is a point estimate, and it hides the uncertainty that comes from sampling randomness. A confidence interval for the mean shows the range within which the true population mean plausibly lies: writing "mean 27.73; 95% CI [24.86; 30.61]" instead of just "mean 27.73" tells the reader how precise the estimate is.
This calculator supports two input modes: you can paste raw data directly, or, if all you have are summary statistics (x̄, s, n), you can enter those. If the population standard deviation (σ) is unknown, the critical value comes from the t distribution; if it is known, it comes from the z distribution. That choice is made automatically and the distribution used is stated explicitly in the results. In measurement, quality control, health, and social science research, APA 7 and most journals expect a confidence interval to accompany any reported mean.
Critical Values (t and z)
The width of the interval is set by the critical value and the standard error. The t critical values used when the population standard deviation is unknown depend on the degrees of freedom and approach z as the sample grows.
- z (90% confidence)
- 1.6449
- α = 0.10; the narrowest interval
- z (95% confidence)
- 1.9600
- α = 0.05; the academic standard
- z (99% confidence)
- 2.5758
- α = 0.01; about 31% wider than the 95% interval
- t (95%, df = 9)
- 2.2622
- n = 10 — with a small sample the interval widens noticeably
- t (95%, df = 24)
- 2.0639
- n = 25
- t (95%, df = 99)
- 1.9842
- n = 100 — already close to the z value
- Margin of error and sample size
- 1 / √n
- Halving the width of the interval requires roughly quadrupling the sample size
Confidence Interval for a Mean
σ unknown: CI = x̄ ± t(1−α/2; n−1) · s / √n σ known: CI = x̄ ± z(1−α/2) · σ / √n Standard error: SE = s / √n (or σ / √n) Margin of error: ME = critical value × SE Interval width: W = 2 · ME Degrees of freed.: df = n − 1 Mean: x̄ = Σxᵢ / n Standard dev.: s = √[ Σ(xᵢ − x̄)² / (n − 1) ]
The critical value is selected automatically: t when σ is not entered, z when it is. The t distribution compensates with its heavier tails for the extra uncertainty of using s in place of σ, which is why it gives a wider interval than z at the same confidence level.
How to Calculate
- Choose the input mode: "Raw data" if you will paste the values, "Summary statistics" if you only have a summary.
- In raw data mode, write the values separated by commas, spaces, or line breaks; the mean and standard deviation are computed automatically.
- In summary mode, enter n, x̄, and s (s being the sample standard deviation with the n−1 denominator).
- If you genuinely know the population standard deviation, switch on the σ option; otherwise leave the default t option.
- Set the confidence level — 95% is the standard choice in academic work.
- Read the margin of error, the bounds, the critical value used, and the degrees of freedom together; the shaded curve shows what the interval corresponds to on the distribution.
Worked Examples
95% confidence interval from raw data
The mean of the 15 measurements is 27.73, the standard deviation 5.39, and the standard error 1.3920. With a t critical value of 2.1448 for df = 14, the margin of error is ±2.986 and the 95% confidence interval is [24.748; 30.719]; the width of the interval is 5.971.
95% confidence interval: [24.748; 30.719] · Lower bound: 24.748 · Upper bound: 30.719
Interval from summary statistics (x̄, s, n)
For n = 25, x̄ = 24.5, and s = 3.2, the standard error is 0.64. With a t critical value of 2.0639 at df = 24, the margin of error is ±1.321 and the 95% confidence interval is [23.179; 25.821] — the same values as the SPSS Explore output.
95% confidence interval: [23.179; 25.821] · Lower bound: 23.179 · Upper bound: 25.821
99% interval with z when σ is known
When the population standard deviation σ = 8 is known, the standard error for n = 100 is 0.8 and the z critical value is 2.5758; the margin of error is ±2.061 and the 99% confidence interval is [47.939; 52.061]. Had the same data been treated as having an unknown σ and computed with t, the critical value would have risen somewhat above 2.5758 and the interval would have been wider.
99% confidence interval: [47.939; 52.061] · Lower bound: 47.939 · Upper bound: 52.061