Confidence Interval Calculator
Work out a confidence interval for a population mean from summary figures or a pasted sample, with the multiplier named and the working shown. Most confidence interval pages hand back two numbers and leave the choice of multiplier unexplained. Here, for a mean of 10, a sample standard deviation of 2 and n 25 at 95%, the standard error is 0.400000, the multiplier is t* 2.063899 on 24 degrees of freedom, the margin is 0.825559, and the interval is 9.17444 to 10.82556. Supply a known population standard deviation instead and the same sample switches to z* 1.959964 and narrows to 9.21601 to 10.78399, which is exactly what that choice is worth. Paste the raw numbers and the mean, the sample standard deviation and the count are worked out here instead.
mean 10 sample SD 2 n 25 df 24 standard error 0.400000 t* (0.975, 24) 2.063899 margin 0.825559 95% CI 9.17444 to 10.82556 t was used because the SD is estimated from the sample assumes independent observations from one population
You already have the mean, the standard deviation and the sample size. Type the three of them and the interval follows.
Calculate an interval for a proportion
95% is how often intervals built this way hold the population mean over repeated samples, not the chance that this one holds it: this interval either does or it does not. t was used because the SD is estimated from the sample. The third case below is the same sample down the other curve, so the cost of that choice is a number rather than an argument.
Common questions
- How do I calculate a confidence interval for a mean?
- Divide the standard deviation by the square root of the sample size to get the standard error. Multiply it by the critical value for your confidence level, then subtract and add that margin to the mean. In Summary, enter the mean, sample standard deviation and sample size; the working shows each step. Use Sample if you have the raw observations, or supply a known population standard deviation to use z instead of t.
- Should I use t or z?
- Use t whenever the standard deviation came from the sample itself, which is almost always. z belongs to the case where the population standard deviation is known ahead of the data, and it gives a narrower interval because it carries no uncertainty about the spread. This page uses t by default and switches to z only when you fill in a known population standard deviation, and it says on screen which one it used and why. For the same sample of 25 the two differ: 9.17444 to 10.82556 with t* 2.063899, against 9.21601 to 10.78399 with z* 1.959964.
- Does a 95% confidence interval mean a 95% chance the true mean is inside it?
- No, and that is the reading the number most often gets. The level describes the method over the long run: draw sample after sample, build an interval this way each time, and about 95 in 100 of those intervals would hold the population mean. The one on your screen either holds it or it does not, and nothing in the data says which. Raising the level widens the interval rather than sharpening the estimate: the same sample at 99% runs 8.88122 to 11.11878.
- Can I paste my raw data instead of the summary?
- Yes. Switch to Sample and paste the numbers separated by spaces, commas, semicolons or new lines, up to 100000 of them, and the mean, the sample standard deviation and the count are worked out here. The list 2, 4, 4, 4, 5, 5, 7, 9 has a mean of 5 and gives 3.21251 to 6.78749 at 95%, with a multiplier of 2.364624 on 7 degrees of freedom. The totals carry a compensation term as they accumulate, so a long sample of large numbers keeps its digits instead of drifting in the fifth decimal.
- What is the smallest sample this works on?
- Two observations. One has no spread to estimate and no degrees of freedom at all, so a sample size of 1 is refused with a message rather than answered. Two is enough for the arithmetic and not much else: at n 2 the multiplier for 95% is 12.706205, against 1.959964 if the standard deviation were known, and the interval that comes out is very wide. That width is the honest answer rather than a fault in the tool.
- How accurate are the t and z multipliers?
- They are computed rather than looked up from a four-figure table. z comes from Cody's rational Chebyshev approximation to the error function, inverted by Acklam's rational approximation and refined against the same curve. t comes from the incomplete beta function, evaluated as a continued fraction carried in two doubles and inverted by a bracketed Newton iteration. Both were measured against an 80-digit reference: t over 170,352 combinations of degrees of freedom and level, z over every level in that grid. The worst relative error found was 2.72e-15 for t and 4.98e-16 for z, so the bound quoted here is 1e-14, comfortably above what the measurement showed.
- How do I use the online calculator at a different confidence level?
- Enter the sample mean, sample standard deviation and sample size in Summary, or choose Sample and paste the observations. Change Confidence level to a value from 50 to 99.9, such as 80, 90, 95, 96 or 99. The result updates with the lower and upper limits, multiplier and margin. Leave Known population SD empty for t; supply it only when that population value is known. The calculator is free, needs no account and runs in a current phone or computer browser.
- What is the equivalent formula in Excel?
- For summary figures in A1 (mean), A2 (sample SD), A3 (sample size) and A4 (confidence level written as 95), the t margin is CONFIDENCE.T(1-A4/100,A2,A3). The limits are A1 minus that margin and A1 plus it. With a known population SD in A2, use CONFIDENCE.NORM instead. These formulas describe a two-sided interval for one population mean, with the same independent-observation assumption.
Exact arithmetic on your sample, using the t distribution when the standard deviation is estimated and z only when you supply a known population one, with the page naming which it used and on how many degrees of freedom. The interval is for the mean of the population the sample came from, assuming independent observations, and that assumption is printed beside it. It reports an interval and draws no conclusion about a treatment, a difference or an investment.