Confidence Interval Calculator

Confidence interval for the population mean, using the t-distribution

Enter your sample data and choose a confidence level to get a confidence interval for the mean. The calculator uses the t-distribution and also reports the margin of error and standard error.

Enter Your Data Points

Textbooks differ — pick the method yours uses.
Confidence interval for the population mean, using the t-distribution.

Confidence interval for the mean

Lower bound19.9701
Upper bound23.1966
Margin of error1.6133
Standard error (s/√n)0.733
t critical value2.201

Two-sided t-interval: mean ± t(n−1) × s/√n.

Five Number Summary

Minimum18
Q1 (25th)19.5
Median21.5
Q3 (75th)23.5
Maximum26
Interquartile range (IQR)4
Count (n)12
Outliers (1.5 × IQR rule)None

Additional Statistics

Mean (average)21.5833
Mode19, 20, 22
Range8
Sum259
Std deviation (sample)2.5391
Std deviation (population)2.431
Variance (sample)6.447
Mean absolute deviation2.0833
Coefficient of variation0.1176
Standard error of the mean0.733
10th percentile19
90th percentile24.9
Lower inner fence (Q1 − 1.5·IQR)13.5
Upper inner fence (Q3 + 1.5·IQR)29.5

Box & Whisker Plot

Histogram

Step-by-step solution

Export & Share

The share link reproduces your exact data and settings — paste it in an email, chat, or assignment and anyone who opens it sees the same results.

Saved Datasets

Saved to this device only (browser local storage). Use a share link to move data between devices.

What is a confidence interval?

A confidence interval is a range of plausible values for an unknown population parameter — here, the population mean — estimated from a sample. A 95% confidence interval means that if you repeated the sampling many times, about 95% of the intervals constructed this way would contain the true mean. It expresses the precision of your estimate: narrower intervals indicate more precise estimates.

How it is calculated

For the mean of a sample, the interval is x̄ ± t × (s ÷ √n), where is the sample mean, s is the sample standard deviation, n is the sample size, and t is the critical value from the t-distribution with n − 1 degrees of freedom at your chosen confidence level. The quantity s ÷ √n is the standard error of the mean, and t × (s ÷ √n) is the margin of error.

Why the t-distribution?

When the population standard deviation is unknown and estimated from the sample — the usual case — the t-distribution gives wider, more honest intervals than the normal distribution, especially for small samples. As the sample size grows, the t-distribution approaches the normal distribution and the two give almost identical results.

Frequently asked questions

What does a 95% confidence interval mean?

It means the method produces an interval that would capture the true population mean about 95% of the time over repeated sampling. It is a statement about the procedure, not a 95% probability that this particular interval contains the mean.

What is the margin of error?

The margin of error is the half-width of the interval: t × (s / √n). The interval is the sample mean plus or minus this amount.

Does this use the t or z distribution?

This calculator uses the t-distribution with n − 1 degrees of freedom, which is appropriate when the population standard deviation is estimated from the sample. For large samples the result is nearly identical to a z-interval.

Related calculators

Guides & how-tos