Confidence Interval Calculator for a Mean (Free)

StatisticsFreeNo sign-up

A confidence interval calculator gives a range of plausible values for a population mean: x̄ ± t* × s/√n. For a sample of 36 test scores with mean 72.4 and standard deviation 9.6, the standard error is 9.6/6 = 1.6, t* = 2.030 for 35 degrees of freedom, and the 95% confidence interval is 72.4 ± 3.25, or 69.15 to 75.65.

Confidence interval for a mean
Population standard deviation σ
Try:
%
95% confidence interval for the population mean
69.1518 to 75.6482

x̄ ± ME = 72.4 ± 3.2482, so the interval is (69.1518, 75.6482).
Point estimate x̄72.4
Margin of error± 3.2482
Standard error SE1.6
Critical value t* (df = 35)2.0301
Interval width6.4963
Sample size n36
What this means
We are 95% confident that the population mean μ lies between 69.1518 and 75.6482. If we repeated the sampling many times, about 95% of intervals built this way would contain the true mean; any single interval either contains it or does not.
Check the shape. With n = 36 the t interval is fine for moderately skewed data, but strong skew or outliers can still make it misleading.
Your interval compared with 90%, 95% and 99%

Interval chart. Point estimate 72.4. 90% interval from 69.6967 to 75.1033; 95% interval from 69.1518 to 75.6482; 99% interval from 68.0419 to 76.7581.707590%95%99%

your 95% intervalpoint estimate x̄ = 72.4
Higher confidence needs a wider interval: the same data give a longer bar at 99% than at 90%.
Show steps
  1. Write down the inputs: x̄ = 72.4, s = 9.6, n = 36, confidence level C = 95%, so α = 1 − C = 0.05.
  2. Standard error: SE = s / √n = 9.6 / √36 = 9.6 / 6 = 1.6.
  3. σ is unknown, so use the t distribution with df = n − 1 = 36 − 1 = 35.
  4. Critical value: t* is the t value with df = 35 that leaves α/2 = 0.025 of the area in each tail: t* = 2.0301.
  5. Margin of error: ME = t* × SE = 2.0301 × 1.6 = 3.2482.
  6. Interval: x̄ ± ME. Lower = 72.4 − 3.2482 = 69.1518; upper = 72.4 + 3.2482 = 75.6482.
  7. Conclusion: We are 95% confident that the population mean μ lies between 69.1518 and 75.6482. If we repeated the sampling many times, about 95% of intervals built this way would contain the true mean; any single interval either contains it or does not.
For comparison, a z interval would use z* = 1.96 and a margin of 3.1359. With σ unknown the t interval is the right choice at any sample size; the two get closer as n grows.
The same data at other confidence levels
Level t* Margin of error Lower Upper
80% 1.3062 2.0899 70.3101 74.4899
90% 1.6896 2.7033 69.6967 75.1033
95% 2.0301 3.2482 69.1518 75.6482
98% 2.4377 3.9004 68.4996 76.3004
99% 2.7238 4.3581 68.0419 76.7581
99.9% 3.5911 5.7458 66.6542 78.1458
t critical values with df = 35. Two-sided intervals. Your level is highlighted.

Confidence Interval Calculator for a Mean (Free)
Embed this calculator on your site

Free to use on class pages, blogs and course pages. Copy the code below and paste it into your page:

How to use the confidence interval calculator

  1. Choose how you will enter the data. Summary stats takes the sample mean, standard deviation and sample size. Raw data takes the values themselves (paste a column from a spreadsheet) and works out n, x̄ and s for you. Two means builds an interval for the difference between two group means.
  2. Say whether the population standard deviation σ is known. Almost always it is not, so keep Unknown and the calculator uses the t distribution. Pick Known only when σ comes from outside the sample.
  3. Type any confidence level (90, 95 and 99 are one tap away, but 97.5 or 99.9 work too) and choose a two-sided interval or a one-sided lower or upper bound.
  4. Read the interval, the margin of error, the standard error and the critical value. Open Show steps for the full working, and use the chart and table to see how the interval changes at other confidence levels.

Confidence interval formula for a mean

Every interval in this calculator has the same shape: estimate ± critical value × standard error. The part after ± is the margin of error (ME).

  • σ unknown (t interval): x̄ ± t* × s/√n, where s is the sample standard deviation and t* comes from the t distribution with df = n − 1.
  • σ known (z interval): x̄ ± z* × σ/√n, where z* comes from the standard normal distribution: 1.645 for 90%, 1.960 for 95%, 2.576 for 99%.
  • Two means (Welch): (x̄₁ − x̄₂) ± t* × √(s₁²/n₁ + s₂²/n₂), with the Welch–Satterthwaite degrees of freedom. The pooled version uses one combined standard deviation and df = n₁ + n₂ − 2.

For a two-sided interval at confidence level C, the critical value leaves α/2 = (1 − C)/2 in each tail. A one-sided bound puts all of α in one tail, so a 95% lower bound uses the same critical value as a two-sided 90% interval. The calculator computes t* exactly from the t distribution for any df, including fractional Welch df, rather than rounding to the nearest table row.

z or t: which interval should you use?

Use the t interval whenever you estimate the spread from the sample itself, which is nearly always. The t distribution has heavier tails than the normal curve, so t* is larger and the interval is wider; that extra width pays for not knowing σ. As n grows the two meet: t* for 95% is 2.262 at df = 9, 2.042 at df = 30 and 1.980 at df = 120, against z* = 1.960.

The “use z when n ≥ 30” shortcut comes from the days of printed tables. With software there is no reason to switch, and the calculator shows the z margin in the steps so you can see how small the difference is. The t interval does assume the population is roughly normal. With fewer than 15 values, use it only if the data show no strong skew or outliers; from about 40 values it is reliable even for skewed data. The raw-data tab flags points outside the 1.5 × IQR fences so you can check them.

Worked examples

Mean with unknown σ: test scores

A sample of n = 36 students has mean 72.4 and standard deviation 9.6. SE = 9.6/√36 = 1.6. With df = 35, t* = 2.0301 for 95%, so ME = 2.0301 × 1.6 = 3.2482. The interval is 72.4 − 3.2482 = 69.1518 to 72.4 + 3.2482 = 75.6482. A 95% lower bound instead uses t* = 1.6896 and gives μ ≥ 69.6967.

Mean with known σ

A machine fills packets with a known standard deviation σ = 2.7 g. A sample of 100 packets averages 22.8 g. SE = 2.7/10 = 0.27, z* = 1.96, ME = 0.5292, and the 95% confidence interval is 22.2708 g to 23.3292 g.

Raw data: battery life

Ten batteries last 12.1, 11.4, 13.0, 12.6, 11.9, 12.8, 12.2, 11.7, 12.5 and 13.1 hours. The mean is 123.3/10 = 12.33 hours and s = 0.5658. SE = 0.5658/√10 = 0.1789, t* = 2.2622 with df = 9, ME = 0.4047, so the 95% interval is 11.93 to 12.73 hours.

Difference of two means

Group 1: mean 78.2, s = 10.4, n = 40. Group 2: mean 72.5, s = 12.1, n = 35. The difference is 5.7 and the Welch standard error is √(10.4²/40 + 12.1²/35) = 2.6243 with df = 67.55, so t* = 1.9957 and the 95% interval is 0.4626 to 10.9374. Zero is not inside the interval, so the difference is significant at the 5% level.

t critical values for confidence intervals

Two-sided confidence levels. For a one-sided 95% bound, use the 90% column.

df 90% 95% 99%
1 6.314 12.706 63.657
2 2.920 4.303 9.925
3 2.353 3.182 5.841
4 2.132 2.776 4.604
5 2.015 2.571 4.032
6 1.943 2.447 3.707
7 1.895 2.365 3.499
8 1.860 2.306 3.355
9 1.833 2.262 3.250
10 1.812 2.228 3.169
15 1.753 2.131 2.947
20 1.725 2.086 2.845
25 1.708 2.060 2.787
30 1.697 2.042 2.750
40 1.684 2.021 2.704
60 1.671 2.000 2.660
120 1.658 1.980 2.617
∞ (z*) 1.645 1.960 2.576

What a 95% confidence interval means

The confidence level describes the method, not one interval. If you took many random samples and built a 95% interval from each, about 95% of those intervals would contain the true mean μ. Any single interval either contains μ or it does not; we simply do not know which. So say “we are 95% confident”, not “there is a 95% probability”.

Three things control the width. A higher confidence level widens it, more spread in the data widens it, and a larger sample narrows it in proportion to √n: four times the data halves the margin of error. To plan a study around a target margin, use the sample size calculator linked below.

Common mistakes

Mistake What to do instead
Using z* = 1.96 with a sample standard deviation Use t* with df = n − 1 when σ is unknown
Dividing by n instead of √n SE = s/√n
Using the population SD formula (divide by n) on raw data The sample SD divides by n − 1
Reading the interval as covering 95% of the data It estimates the mean; individual values spread much wider
Rounding t* or SE early Keep 4 or more decimals until the final step
Ignoring outliers in a small sample Check the data; one extreme value can move the whole interval

Checking homework by hand and with the calculator

Work the problem on paper first: write x̄, s and n, find SE, look up t* in the table above, then compute the margin of error and both ends. Then compare each line of Show steps with yours. A small mismatch usually means a rounded t* or SE; a large one usually means z was used instead of t, or n instead of √n.

Confidence intervals practice quiz: 10 questions

Test yourself with 10 multiple-choice questions. Choose an answer and press Submit to see if you are right and why. Your score appears at the end.

Question 1 of 10
1. A sample has s = 12 and n = 16. What is the standard error of the mean?

Found a mistake? Let us know!

2. A sample of n = 20 is used to build a t interval for the mean. How many degrees of freedom does t* use?

Found a mistake? Let us know!

3. Which critical value goes with a 95% z interval?

Found a mistake? Let us know!

4. x̄ = 40, σ = 5 (known) and n = 25. What is the 95% confidence interval?

Found a mistake? Let us know!

5. A 95% interval for a mean is 18.2 to 21.8. What are the point estimate and margin of error?

Found a mistake? Let us know!

6. With σ unknown, x̄ = 50, s = 8, n = 25, what is the 95% margin of error?

Found a mistake? Let us know!

7. If everything else stays the same, how must the sample size change to halve the margin of error?

Found a mistake? Let us know!

8. What happens to a confidence interval when the confidence level rises from 90% to 99%?

Found a mistake? Let us know!

9. Which statement correctly describes a 95% confidence interval of 69.2 to 75.6 for a mean?

Found a mistake? Let us know!

10. A 95% interval for μ₁ − μ₂ is −1.2 to 4.5. What does it tell you?

Found a mistake? Let us know!

Frequently asked questions

What is the confidence interval formula?

For a mean with unknown σ, CI = x̄ ± t* × s/√n with df = n − 1. With known σ, replace t* with z* and s with σ. For example, x̄ = 50, s = 8, n = 25 at 95% gives SE = 1.6, t* = 2.0639 and an interval of 46.70 to 53.30.

How do you calculate a 95% confidence interval?

Find the standard error s/√n, multiply it by the 95% critical value (t* with df = n − 1, or 1.96 if σ is known) to get the margin of error, then subtract it from and add it to the sample mean.

How do you find a confidence interval on a TI-84?

Press STAT, go to TESTS and choose 8:TInterval (σ unknown) or 7:ZInterval (σ known). Pick Stats to enter x̄, Sx and n, or Data to use a list, set C-Level to 0.95 and choose Calculate. The answer should match this calculator.

How do you find the critical value for a confidence level?

For a two-sided level C, find the value that leaves (1 − C)/2 in the upper tail. For z that gives 1.645, 1.960 and 2.576 at 90%, 95% and 99%. For t it also depends on df; the table above lists common values and the calculator works it out for any level and df.

When should you use the t-distribution for a confidence interval?

Whenever σ is unknown and you use the sample standard deviation, at any sample size. The t interval also needs roughly normal data when n is small.

What is the confidence interval formula in Excel?

=CONFIDENCE.T(0.05, s, n) returns the margin of error for a 95% t interval, and =CONFIDENCE.NORM(0.05, σ, n) the z version. Subtract the result from the mean and add it to the mean to get the two ends.

Related calculators

More statistics calculators

Browse all 206 calculators

Related to This Article

What people say about "Confidence Interval Calculator for a Mean: t or z, Steps"?

No one replied yet.

Leave a Reply