Confidence Interval Calculator
Enter your sample mean, standard deviation, and sample size to calculate the margin of error and confidence interval bounds.
Calculator verified • Last updated: August 2026
—
The Interval, Visually
The shaded band is your confidence interval — the range your true population value is likely to fall in. The marked point is your sample mean; a wider band means more uncertainty, usually from a smaller sample.
How to Calculate a Confidence Interval
A confidence interval starts with your sample mean, then adds and subtracts a margin of error built from how spread out your data is and how confident you want to be. First calculate the standard error — the standard deviation divided by the square root of the sample size. Then multiply the standard error by a critical value that depends on your chosen confidence level and, for small samples, the t-distribution.
x̄: the sample mean.
t*: the critical value from the t-distribution, based on your chosen confidence level and degrees of freedom.
s: the sample standard deviation.
n: the sample size.
For example, a sample of 30 items with a mean of 100 and a standard deviation of 15 has a standard error of . At 95% confidence with 29 degrees of freedom, the critical t-value is about 2.045, giving a margin of error of roughly ±5.60 — a 95% confidence interval of about 94.4 to 105.6.
Why t-Distribution Instead of Normal?
The t-distribution is shaped like the normal distribution but with heavier tails, which widens the interval slightly to account for the extra uncertainty of estimating the population standard deviation from a sample rather than knowing it exactly. As sample size grows, the t-distribution converges toward the normal (z) distribution — by the time n exceeds a few hundred, the two are nearly indistinguishable.
Confidence Level Trade-offs
Choosing a higher confidence level — say 99% instead of 95% — makes the interval wider, because you're demanding more certainty that it captures the true value. There's no free lunch: greater confidence always costs precision, and greater precision (a narrower interval) always costs confidence, unless you increase your sample size.
What a Confidence Interval Does Not Mean
A common misconception is that a 95% confidence interval means "there's a 95% chance the true value is in this specific interval." That's not quite right — once calculated, a specific interval either contains the true value or it doesn't. The 95% refers to the long-run reliability of the method: if you repeated the sampling and calculation process many times, about 95% of the resulting intervals would contain the true population parameter.
A Brief History of the Confidence Interval
The confidence interval as a formal statistical tool was introduced by Polish mathematician and statistician Jerzy Neyman in a landmark 1937 paper, as part of his broader development of frequentist statistical theory. Neyman's framework was, in part, a deliberate alternative to earlier, less rigorously defined ways of expressing uncertainty around an estimate, and it built on foundational work by Ronald Fisher and William Sealy Gosset (who published under the pseudonym "Student" and developed the t-distribution in 1908 while working at the Guinness brewery, needing small-sample statistical methods for quality control). Neyman's precise, repeated-sampling interpretation of confidence intervals — the one covered above — was influential specifically because it gave researchers a rigorous way to express uncertainty without claiming a probability about a fixed, already-determined true value, a subtle distinction that still trips up newcomers to statistics today.
Common Confidence Interval Mistakes
Misinterpreting a 95% confidence interval as "a 95% probability the true value is inside this specific interval" is the single most common error, as explained above — the correct interpretation is about the reliability of the method across repeated sampling, not a probability statement about one already-calculated interval. Using a z-distribution instead of a t-distribution for small samples is another frequent mistake, since the t-distribution's wider tails account for the extra uncertainty that comes from estimating the population standard deviation from a small sample rather than knowing it exactly. Assuming a narrower interval is always "better" without considering that it comes from a lower confidence level is a third — a tighter interval you trust less isn't necessarily more useful than a wider one you trust more.
Confidence Interval Terms You Should Know
Margin of Error — the amount added to and subtracted from the point estimate to form the interval's upper and lower bounds.
Confidence Level — the long-run percentage of intervals, across repeated sampling, that would be expected to contain the true population parameter (commonly 90%, 95%, or 99%).
t-Distribution — a probability distribution similar to the normal distribution but with heavier tails, used when the sample size is small or the population standard deviation is unknown.
Degrees of Freedom — a value (typically sample size minus 1) that determines the exact shape of the t-distribution used in the calculation.
Frequently Asked Questions
What is a confidence interval?
A confidence interval is a range of values, calculated from your sample, that is likely to contain the true population parameter. A 95% confidence interval means that if you repeated the sampling process many times, about 95% of the intervals produced would contain the true value.
Should I use 95% or 99% confidence?
95% is the most common default and balances precision with confidence. 99% gives a wider, more conservative interval that's more likely to contain the true value, at the cost of a larger margin of error. Use 99% when the cost of being wrong is high.
When should I use a t-distribution instead of a z-distribution?
Use the t-distribution whenever the true population standard deviation is unknown and estimated from the sample — which is true in most real-world cases. Use the z-distribution only when the population standard deviation is genuinely known in advance.
Does a larger sample size narrow the confidence interval?
Yes. The margin of error shrinks as sample size grows, because standard error is divided by the square root of n. Quadrupling your sample size roughly halves the margin of error, all else being equal.