Confidence Interval Calculator

Enter a sample mean, standard deviation and size to get the margin of error and the full confidence interval for the population mean, from 80% to 99.9%, with the correct t or z critical value chosen automatically.

What you get
  • Interval with margin of errorLower and upper bounds plus the standard error behind them.
  • Correct t or z valueThe t distribution for unknown population SD, z when it is known.
  • Visual curve of the intervalSee exactly which range the shaded confidence region covers.

Sample details

Results update as you type

Runs entirely in your browser. Nothing you type is sent or saved

Confidence interval guide

What a confidence interval is, and what it is not

A sample tells you about the sample. A confidence interval turns that sample into a honest statement about the population you drew it from: a range of values that the true population mean plausibly sits in, with a stated level of reliability. A 95% confidence interval for a sample mean of 100 might run from 95.74 to 104.26, which says the data is compatible with any true mean in that neighborhood.

The word confidence has a precise meaning here, and it is probably not the one most people assume. It does not mean there is a 95% chance that the true mean falls inside this particular interval. The true mean is a fixed number, not a random one; it either is inside your interval or it is not. What the 95% describes is the procedure: if you drew sample after sample and built an interval from each one, about 95% of those intervals would capture the true mean. You cannot know whether yours is one of the lucky ones, which is exactly why the range, not a single point estimate, is the honest summary.

Common misreading: "there is a 95% probability the mean is between 95.74 and 104.26" is wrong. Right reading: "intervals built this way capture the true mean 95% of the time, so this range is a reliable estimate of where it sits."

The four inputs

  • Sample mean (x̄): the average of your measurements. It is the center of the interval and the best single guess for the population mean.
  • Standard deviation (s): how widely your individual measurements scatter. A larger s means noisier data, which forces a wider interval for the same sample size.
  • Sample size (n): how many observations you have. Its square root drives the standard error, so accuracy improves slowly: to halve the margin of error you need about four times the data.
  • Confidence level: how often you want the procedure to succeed, from 80% to 99.9% here. Higher levels produce wider intervals, because the only way to be more sure of capturing the mean is to claim a bigger range.

The toggle for a known population SD switches the mathematics between two distributions, which the next section explains.

How the confidence interval is calculated

Three steps build the interval: measure the precision of your sample, look up how much slack your confidence level demands, and add the two together.

SE = s ÷ √n

SE is the standard error: the standard deviation of the sample mean itself. Averages of many observations vary less than single observations, by a factor of √n.

ME = critical × SE

ME is the margin of error. The critical value comes from the t distribution when the population SD is unknown (the normal case) or from the z distribution when it is known.

CI = x̄ ± ME

The full interval: lower bound = x̄ - ME, upper bound = x̄ + ME.

Worked example: the usual case, unknown population SD

Take a sample mean of 100, a sample SD of 15 and n = 50 at 95% confidence. The standard error is 15 ÷ √50 = 2.1213. Because the population SD is unknown, the critical value comes from the t distribution with n - 1 = 49 degrees of freedom: t = 2.0096, just above the z value of 1.9600. The margin of error is 2.0096 × 2.1213 = 4.2630, so the interval runs from 95.74 to 104.26. The calculator reproduces these figures exactly.

Worked example: known population SD

Tick Population SD known on the same numbers and the critical value switches to the z distribution: 1.959964 at 95%. The margin of error tightens to 4.1577 and the interval to 95.84 to 104.16. It is only slightly narrower, which is why the distinction matters more in principle than in practice once n is moderately large.

Worked example: a small sample

Small samples pay twice. Take the mean of 22.14 and SD of 13.29 from seven observations at 95%. The standard error is 13.29 ÷ √7 = 5.0231, and the t critical value with 6 degrees of freedom swells to 2.4469, well above the z value. The margin of error is 12.2912 and the interval spans 9.85 to 34.43, wider than the data's own SD. That is the t distribution honestly charging you for the uncertainty of a tiny sample.

What makes the interval wider or narrower

Three levers control the width, and two of them are trade-offs:

  • Sample size: the only free lunch. More data shrinks the standard error, and the t critical value also relaxes toward the smaller z value as degrees of freedom grow. Going from n = 10 to n = 100 cuts the margin of error by roughly two thirds.
  • Confidence level: demanding 99% success instead of 95% widens the interval by about 30% for the same data (the critical value rises from 1.96 to 2.576 for large n). You pay certainty with width.
  • Standard deviation: not a choice but a fact about your data. If measurements are inherently noisy, the only remedy is more of them, or a better instrument that removes some of the noise at the source.

Overlapping intervals are not a significance test

A widespread habit is to build two confidence intervals, one per group, and declare a difference significant only if the intervals do not overlap. The logic feels intuitive and it is wrong in both directions. Two 95% intervals can overlap while the difference between the group means is statistically significant, because the difference is measured more precisely than either group alone: each group's interval must cover its own uncertainty, while the comparison only needs to beat the combined uncertainty. And when intervals barely fail to overlap, the conclusion "significant" is right only by luck of the geometry.

The correct comparison computes an interval for the difference between the two means, using both samples' information at once, and checks whether that interval contains zero. Until you have such a tool in front of you, treat side-by-side intervals as descriptive pictures, not as the verdict of a comparison.

How to report a confidence interval

Clear reporting costs one sentence and saves every reader a calculation. The standard pattern, used in APA and most scientific style guides, puts the estimate, the level and the bounds together: "the mean response time was 412 ms, 95% CI [398.1, 425.9]". Four habits make such lines trustworthy:

  • Name the level every time, because an unlabeled interval is uninterpretable.
  • Match the decimals to the data: report bounds to the precision you actually measured, not to whatever the calculator printed.
  • Keep the bounds in the same units as the estimate, and use square brackets with a comma, the format readers of journals expect.
  • Say what the interval is for when several appear in one report, since a CI for a mean and a CI for a difference answer different questions.

A short history: the brewery that gave statistics the t

In the early 1900s, William Sealy Gosset worked as a chemist at the Guinness brewery in Dublin, where the practical problem was quality control on tiny samples: you cannot test every barrel of stout. The statistics of the day assumed large samples, and Guinness routinely drew just a handful of observations per batch, where the bell curve's promises quietly fail.

Gosset worked out the exact small-sample mathematics: a family of bell-like curves with heavier tails, indexed by what is now called the degrees of freedom. Guinness, wary of trade secrets, forbade employees from publishing, so Gosset wrote under the pen name "Student", and his 1908 paper gave the world Student's t-distribution, the very distribution this calculator uses whenever the population SD is unknown. Ronald Fisher later formalized the theory, and the t-based confidence interval became the default instrument of experimental science. Every "95% CI" you have ever read is, in a real sense, a souvenir of brewing.

Using the calculator well

  • Report the full interval, not just the bounds. Standard practice writes "the mean was 100.0, 95% CI [95.7, 104.3]". That one line tells a reader the estimate, its precision and the reliability of the procedure all at once.
  • Leave the population SD toggle off unless you truly know σ. It applies when the SD comes from long historical experience or a controlled process, not from the same sample you are averaging. With n above roughly 30 the two answers differ by pennies anyway.
  • Mind the assumptions. The interval assumes independent observations and a roughly normal sampling distribution for the mean. The central limit theorem makes the normality assumption forgiving for large n even with skewed data, but for small samples from visibly non-normal data the true coverage can be worse than advertised.
  • Do not stack interpretations on one interval. Repeatedly sampling until an interval looks decisive distorts the 95% guarantee. Decide the confidence level and the sample size before you look.
  • Watch what the interval excludes. A 95% CI for a mean improvement of 0.2 running from -0.4 to 0.8 tells you the data cannot distinguish the effect from zero, which is a finding in itself.

Common questions

It means the method works 95% of the time: if you repeated the sampling and interval-building many times, about 95 of every 100 intervals would contain the true population mean. It does not mean this specific interval has a 95% chance of containing the mean, because the mean is fixed and your single interval either includes it or does not.

Use t whenever you estimated the standard deviation from the sample itself, which is the normal situation; leave the "Population SD known" toggle off. Use z only when the population SD is genuinely known from outside sources. For sample sizes above about 30 the two differ by less than the second decimal place, so the choice stops mattering in practice.

Increase the sample size, which shrinks the standard error by the square root of n; to halve the margin of error you need roughly four times the observations. The other levers are trade-offs: lowering the confidence level narrows the interval but makes the procedure less reliable, and reducing the standard deviation requires better measurements rather than more arithmetic.

The t distribution already compensates for small samples by widening the interval, and its coverage stays honest when the underlying data is roughly symmetric. For visibly skewed data with fewer than about 15 observations, the stated confidence level can be optimistic, and a non-parametric method such as bootstrapping is the safer tool. Large samples are forgiving: the central limit theorem makes the mean nearly normal regardless of the data's shape.

Not with this page. Proportions use a different standard error, √(p(1 - p) ÷ n), and the logic of the interval is the same but the inputs are a count of successes rather than a mean and SD. Enter the proportion as a percentage in a pinch only for large samples, and prefer a dedicated proportion calculator for anything you plan to publish.

Width scales with the standard deviation and shrinks with the square root of the sample size, so a wide interval usually means a small sample or noisy measurements. Published studies often aggregate hundreds or thousands of observations. Compare your n with theirs before concluding your data is unusual, and remember that a wide interval stated honestly beats a narrow one that the data cannot support.

It is more reliable and less informative, which is the trade-off. Raising the level widens the interval (about 30% wider for large samples), so you are surer of capturing the mean but say less about where it lies. The right level depends on the cost of being wrong: exploratory work often uses 90%, published research 95%, and safety-critical decisions 99% or more.

Because the t distribution's shape depends on the degrees of freedom, n - 1. With few observations, the estimated SD is itself uncertain, so the curve grows heavier tails and the critical value rises, from 2.4469 at df = 6 down toward the familiar 1.959964 as df climbs. In the limit the t distribution becomes exactly the normal curve, which is why large-sample results look like textbook z values.

No. Overlap is not a significance test, and it fails in both directions: groups with clearly different means can still have overlapping individual intervals, and barely separated intervals do not guarantee significance. The sound comparison builds an interval for the difference between the two means and checks whether it contains zero, as the guide section above explains.

No. Every calculation runs in your browser. Nothing is stored or transmitted.

Know where the truth probably lives. In seconds.

Browse all math calculators