ZestCalc
Appearance
Language

Confidence Interval Calculator for a Mean

Estimate a population mean from summary statistics with z-score or t-score critical values.

Enter summary statistics

Average of the sample observations.

Number of observations used for the estimate.

Enter the value, then mark whether it came from the sample or the population.

This standard deviation is

Estimated from the same sample. Auto uses a t-score.

Use a preset or enter a custom percentage. Common custom values are 50 to 99.99.

Fillsxˉ\bar{x}meansssample deviationnnsample size

Summary preview

nn

0

xˉ\bar{x}

--

ss

--

Critical value method

Auto selected method

t-scoret1α/2, 24t_{1-\alpha/2,\ 24}df = 24

Auto chose a t-score with df = 24 because the standard deviation is estimated from the sample.

Critical value

2.063899

Results

Confidence interval

39.940766μ45.05923439.940766 \le \mu \le 45.059234

Formula
xˉMEμxˉ+ME\bar{x} - ME \le \mu \le \bar{x} + ME
Values
42.52.559234μ42.5+2.55923442.5 - 2.559234 \le \mu \le 42.5 + 2.559234

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 meanxˉ\bar{x}

42.5

Margin of error

2.559234

Standard errorSE\mathrm{SE}

1.24

Critical valuet1α/2,dft_{1-\alpha/2,df}

2.063899

Method

t-score

df

24

Distribution and critical values

95% confidence area±t1α/2, 24=±2.0639\pm t_{1-\alpha/2,\ 24}=\pm 2.0639ME=2.5592ME=2.5592
Distribution curve showing shaded confidence level, critical values, and confidence interval endpoints.95% confidence area-t*+t*2.5%2.5%LowerMeanUppersample mean
Lower39.940766
Mean42.5
Upper45.059234

Step-by-Step Calculation

1. Identify the inputs

xˉ=42.5, s=6.2, n=25, C=95%, method=t-score\bar{x}=42.5,\ s=6.2,\ n=25,\ C=95\%,\ \text{method}=t\text{-score}

2. Calculate the standard error

SE=sn=6.225=1.24SE=\frac{s}{\sqrt{n}}=\frac{6.2}{\sqrt{25}}=1.24

3. Find the critical value

df=n1=24, t1α/2, 24=2.063899df=n-1=24,\ t_{1-\alpha/2,\ 24}=2.063899

4. Calculate the margin of error

ME=2.063899×1.24=2.559234ME=2.063899\times 1.24=2.559234

5. Calculate the confidence interval

xˉ±ME=42.5±2.55923439.940766μ45.059234\bar{x}\pm ME=42.5\pm 2.559234\Rightarrow 39.940766 \le \mu \le 45.059234

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 xˉ\bar{x}, it reports an interval centered on that mean with a margin of error on both sides.

The basic structure is:

xˉ±critical value×standard error\bar{x} \pm \text{critical value} \times \text{standard error}

For a mean, the standard error is:

SE=standard deviationnSE = \frac{\text{standard deviation}}{\sqrt{n}}

So the interval gets narrower when the standard deviation is smaller or the sample size nn 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:

110.952=0.9751 - \frac{1 - 0.95}{2} = 0.975

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 xˉ+critical value×SE\bar{x} + \text{critical value} \times SE. A lower bound answers "how small could the population mean reasonably be?" and has the form xˉcritical value×SE\bar{x} - \text{critical value} \times SE. 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 σ\sigma is known. This is common in textbook problems where σ\sigma is explicitly provided.

Use a t-score when the standard deviation comes from the sample, written as ss. The t-score depends on degrees of freedom:

df=n1df = n - 1

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 ss or population σ\sigma. In Auto mode, sample ss uses a t-score and population σ\sigma 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 ss or population σ\sigma. 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 xˉ\bar{x}, sample standard deviation, and nn.

Worked example

Suppose a sample has mean xˉ=42.5\bar{x}=42.5, sample standard deviation s=6.2s=6.2, sample size n=25n=25, and confidence level 95%.

Because the standard deviation is from the sample, use a t-score with:

df=251=24df = 25 - 1 = 24

For 95% confidence and df=24df=24, the critical value is approximately:

t0.975,24=2.0639t_{0.975,24} = 2.0639

The standard error is:

SE=6.225=1.24SE = \frac{6.2}{\sqrt{25}} = 1.24

The margin of error is:

ME=2.0639×1.242.56ME = 2.0639 \times 1.24 \approx 2.56

The confidence interval is:

42.5±2.56=[39.94, 45.06]42.5 \pm 2.56 = [39.94,\ 45.06]

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 σ\sigma is known. Use t-score when your standard deviation is the sample standard deviation ss. 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 n\sqrt{n}. Smaller nn 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.