Confidence Interval Calculator for a Mean
Estimate a population mean from summary statistics with z-score or t-score critical values.
Enter summary statistics
Results
Confidence interval
At the 95% confidence level, the population mean is estimated to be between 39.940766 and 45.059234.
Auto chose a t-score with df = 24 because the standard deviation is estimated from the sample.
Lower bound
39.940766
Upper bound
45.059234
Sample mean
42.5
Margin of error
2.559234
Standard error
1.24
Critical value
2.063899
Method
t-score
df
24
Distribution and critical values
Step-by-Step Calculation
1. Identify the inputs
2. Calculate the standard error
3. Find the critical value
4. Calculate the margin of error
5. Calculate the confidence interval
Understanding a confidence interval for a mean
A confidence interval for a mean uses sample data to estimate a reasonable range for an unknown population mean. Instead of reporting only one value, such as the sample mean , it reports an interval centered on that mean with a margin of error on both sides.
The basic structure is:
For a mean, the standard error is:
So the interval gets narrower when the standard deviation is smaller or the sample size is larger.
What the confidence level means
A 90%, 95%, or 99% confidence level describes the long-run reliability of the method. If you repeatedly took random samples and built intervals the same way, about 90%, 95%, or 99% of those intervals would capture the true population mean.
Higher confidence requires a larger critical value, so a 99% interval is wider than a 95% interval using the same data. A 90% interval is narrower, but it uses a method with lower long-run capture rate.
Two-sided and one-sided intervals
This calculator builds a two-sided confidence interval. That means the interval has a lower endpoint and an upper endpoint, and the uncertainty is split evenly across the two tails of the distribution.
For example, a 95% two-sided interval leaves 5% outside the interval: 2.5% in the left tail and 2.5% in the right tail. The critical value therefore comes from the 97.5th percentile:
A one-sided confidence bound answers a different question. An upper bound answers "how large could the population mean reasonably be?" and has the form . A lower bound answers "how small could the population mean reasonably be?" and has the form . People sometimes describe these as right-sided or left-sided bounds, but upper bound and lower bound are usually clearer.
Because one-sided bounds put all of the error probability on one side, their critical values are different from the two-sided values shown here. A 95% one-sided bound uses the 95th percentile, not the 97.5th percentile used by a 95% two-sided interval. Use the two-sided result when you want a range around the mean; use a one-sided bound only when the statistical question is specifically about an upper or lower limit.
z-score or t-score
Use a z-score when the population standard deviation is known. This is common in textbook problems where is explicitly provided.
Use a t-score when the standard deviation comes from the sample, written as . The t-score depends on degrees of freedom:
The t distribution has heavier tails for small samples, which makes the interval wider. As the sample size grows, the t-score approaches the z-score.
This is why the calculator asks whether your standard deviation is sample or population . In Auto mode, sample uses a t-score and population uses a z-score. Manual z-score or t-score selection is available when a class, table, or workflow requires a specific method.
How to use the calculator
Enter the sample mean, standard deviation, sample size, and confidence level. Choose whether the standard deviation is sample or population . Leave the method on Auto for most problems, or manually choose z-score or t-score when your assignment or lookup table asks for it.
If you have raw observations instead of summary statistics, use the raw data helper. Paste values separated by commas, spaces, or line breaks, then apply them to fill , sample standard deviation, and .
Worked example
Suppose a sample has mean , sample standard deviation , sample size , and confidence level 95%.
Because the standard deviation is from the sample, use a t-score with:
For 95% confidence and , the critical value is approximately:
The standard error is:
The margin of error is:
The confidence interval is:
In real-world language: at the 95% confidence level, the population mean is estimated to be between about 39.94 and 45.06. The margin of error, about 2.56, is the distance from the sample mean to either end of the interval.
Assumptions and cautions
The data should come from a random or representative sample. Observations should be independent, meaning one observation should not determine another.
The population should be roughly normal, or the sample size should be large enough for the normal approximation to be reasonable. Outliers, strong skew, measurement problems, and biased samples can make the interval misleading even when the formula is calculated correctly.
FAQ
Should I use z-score or t-score?
Use z-score when the population standard deviation is known. Use t-score when your standard deviation is the sample standard deviation . In most real sample-summary problems, t-score is the safer default.
Why does a smaller sample size make the interval wider?
The standard error divides by . Smaller gives a larger standard error, so the margin of error increases.
Why does a higher confidence level make the interval wider?
A higher confidence level uses a larger critical value. That larger critical value multiplies the standard error, increasing the margin of error.
Is this calculator two-sided or one-sided?
It is two-sided. The calculator reports both a lower bound and an upper bound, with the leftover probability split equally between the two tails. For a one-sided upper or lower bound, use a one-sided critical value instead of the two-sided critical value shown in the results.
What happens if the standard deviation is 0?
The standard error is 0, the margin of error is 0, and the interval collapses to the mean. This can happen when all observed values are identical, but it should also prompt you to check whether the data entry is correct.
Can I use this for non-normal data?
Sometimes. If the sample size is large and the data is not extremely skewed or dominated by outliers, the normal approximation may be reasonable. For small samples from strongly non-normal data, use caution and consider a method designed for that situation.
Related Tools
Other statistics calculators that pair well with confidence interval work.