Confidence Interval Calculator
Calculate a confidence interval for a mean, a proportion, a difference between two groups, a paired difference, a standard deviation, a correlation or an event rate — with the recommended method chosen for you, the formula substituted with your own numbers, every step shown and the critical value independently verified.
Result
- Point estimate
- 72
- Margin of error
- 4.1277971233
- Standard error
- 2
- Critical value
- 2.0638985616
- Degrees of freedom
- 24
- Method
- Student's t interval
- Confidence level
- 95% (α = 0.05, α/2 = 0.025 per tail)
- Width
- 8.2555942465
Recommended method — why this method?
Student's t interval
The spread you supplied is estimated from the sample (s), so the extra uncertainty of estimating it is carried by Student’s t with 24 degrees of freedom. Z is used for a mean only when the population standard deviation σ is genuinely known in advance — which is rare outside textbook problems. Large n does not change this: t simply converges toward Z.
Interval on a number line
What this interval means
The 95% confidence interval for the population mean μ runs from 67.8722028767 to 76.1277971233. Values in that range are the ones consistent with your data at this confidence level; values outside it are not.
The confidence attaches to the procedure: if this study were repeated many times and an interval built the same way each time, about 95% of those intervals would contain the true population mean μ. The true value is a fixed, unknown number — it is either inside this particular interval or it is not, and no probability attaches to that.
Step-by-step calculation
Generated from the inputs above — change any input, the method or the confidence level and every line changes with it.
- 1. Point estimate: the sample mean x̄ = 72.
- 2. Standard error: SE = s / √n = 10 / √25 = 2.
- 3. Critical value: because the spread is the SAMPLE standard deviation s, Student’s t applies with df = n − 1 = 24. t* at 95% confidence (α = 0.05, α/2 = 0.025 in each tail) = 2.063898562.
- 4. Margin of error: ME = t* × SE = 2.063898562 × 2 = 4.127797123.
- 5. Interval: x̄ ± ME = 72 ± 4.127797123 = [67.87220288, 76.12779712].
Formula, substitution and result
- Symbolic formula
CI = x̄ ± t*(α/2, n−1) · (s / √n)- Substitution
72 ± 2.063898562 × (10 / √25)- Numeric result
[67.8722028767, 76.1277971233]
Verification receipt
The critical value is obtained by a bracketed numerical inversion. The check below feeds it back into the distribution’s CDF and reports the observed residual against the tolerance — it measures the quality of the quantile actually used, it is not a decoration.
Verification receipt
- Method
- Round-trip quantile check
- Engine version
- 1.0.0
- Distribution
- Student's t (df = 24)
- Target quantile probability
- 0.975
- Critical value
- 2.0638985616280263
- CDF evaluated back at the critical value
- 0.975
- Residual
- 0
- Tolerance
- 1e-10
- Status
- passed
Assumptions this method requires
These change with the method. Normality is not a universal requirement for a confidence interval, so it is listed only where it genuinely applies.
- The observations are independent and come from a random sample of the population.
- The population is approximately normal, or n is large enough for the sampling distribution of the mean to be approximately normal. Student’s t is fairly robust to moderate departures from normality but not to strong skew or influential outliers at small n.
- The standard deviation is estimated from the sample, which is why t (not Z) is used.
Compare the methods on the same data
Method comparison is available for a single proportion and for a difference between two proportions, where the choice of method genuinely changes the answer.
The forest plot is drawn alongside the method comparison for proportion modes.
Data audit table
Switch a mode to raw-data input to see every observation’s contribution here.
Reproduce this result
Snippets appear only where the named function really computes the selected method. Where no built-in reproduces it — CONFIDENCE.T does not compute a Wilson or Clopper–Pearson interval — the page says so instead of offering a formula that would return something else.
Excel / Google Sheets
=CONFIDENCE.T(0.05, 10, 25) → margin of errorR
72 + c(-1, 1) * qt(0.975, df = 24) * 10 / sqrt(25)Python (SciPy)
from scipy import stats
stats.t.interval(0.95, df=24, loc=72, scale=10/25**0.5)What is a confidence interval?
A confidence interval is a range of values, computed from your data, that is designed to contain an unknown population quantity a stated proportion of the time. A 95% confidence interval for a mean, for example, is produced by a procedure that captures the true mean in 95% of repeated samples.
More precisely: the population quantity — a mean μ, a proportion p, a difference, a correlation ρ — is a fixed but unknown number. Your sample gives a point estimate of it, and that estimate would come out differently with a different sample. A confidence interval quantifies exactly that sample-to-sample variability. It is built by taking the point estimate and moving out from it by a margin of error, which is a critical value from the appropriate sampling distribution multiplied by the estimate’s standard error. The confidence level you choose (the confidence coefficient, 1 − α) fixes the critical value; the data fix everything else.
The interval is therefore a statement about the reliability of a procedure, not a probability distribution over the parameter. Which distribution supplies the critical value depends on what you are estimating and on what you know — that is why this page asks first, and picks the method second.
What 95% confidence actually means
Imagine repeating your whole study a thousand times — same population, same sample size, new random sample each time — and computing a 95% interval each time. About 950 of those intervals would contain the true parameter and about 50 would miss it. That long-run capture rate is the coverage, and it is what “95% confidence” refers to.
The interval on your screen is one draw from that process. The parameter is a fixed number, so your interval either contains it or it does not; there is no 95% chance attached to this interval, because nothing about it is still random once the data are in. Saying that the true value has a 95% probability of lying between these two numbers swaps a statement about the procedure for a statement about the parameter, and frequentist confidence does not license that swap.
The distinction is not pedantry — it changes what you may conclude. Parameter uncertainty in the frequentist sense is uncertainty about which of many possible intervals you happened to get. A Bayesian posterior assigns probability directly to ranges of parameter values — a genuinely different quantity, which requires a prior and produces a credible interval. The Jeffreys option in the proportion mode is the Bayesian one on this page, and it is labelled as such precisely because its interpretation differs.
Two more things 95% confidence does not mean. It says nothing about where your individual observations sit — locating those needs a tolerance or prediction statement, not a confidence interval for a parameter. And it does not promise that a repeat study’s estimate would land inside this interval 95% of the time.
Confidence interval formula
Every confidence interval on this page is an instance of one pattern — estimate ± (critical value × standard error) — except where the sampling distribution is not symmetric, in which case the bounds come from inverting the distribution directly. Here is the formula for each parameter.
Mean, with the standard deviation estimated from the sample (Student’s t)
CI = x̄ ± t*(α/2, n−1) · ( s / √n )
Mean, with a known population standard deviation (Z)
CI = x̄ ± z*(α/2) · ( σ / √n )
Proportion (Wilson score — the recommended default)
CI = [ p̂ + z²/2n ± z·√( p̂(1−p̂)/n + z²/4n² ) ] / ( 1 + z²/n )
The Wald form p̂ ± z·√(p̂(1−p̂)/n) is the one most textbooks show first. It is included in the comparison table above for exactly that reason, and it is not what this page recommends.
Difference between two independent means (Welch)
CI = (x̄₁ − x̄₂) ± t*(α/2, ν) · √( s₁²/n₁ + s₂²/n₂ )
ν = ( s₁²/n₁ + s₂²/n₂ )² / [ (s₁²/n₁)²/(n₁−1) + (s₂²/n₂)²/(n₂−1) ]
Difference between two independent proportions (Newcombe hybrid score)
lower = (p̂₁ − p̂₂) − √( (p̂₁ − l₁)² + (u₂ − p̂₂)² )
upper = (p̂₁ − p̂₂) + √( (u₁ − p̂₁)² + (p̂₂ − l₂)² )
where (lᵢ, uᵢ) is the Wilson score interval for group i
Paired mean difference
CI = d̄ ± t*(α/2, n−1) · ( s_d / √n )
Variance and standard deviation (chi-square)
(n−1)s² / χ²(1−α/2, n−1) ≤ σ² ≤ (n−1)s² / χ²(α/2, n−1)
take square roots of both bounds for σ
Correlation (Fisher z transformation)
z = ½·ln( (1+r) / (1−r) ), SE = 1/√(n−3)
CI = tanh( z ± z*(α/2)·SE )
Poisson count and event rate (exact)
CI for λ = [ ½·χ²(α/2, 2x), ½·χ²(1−α/2, 2x+2) ]
for a rate, divide both bounds by the exposure T
How to calculate a confidence interval
Whether you are computing, finding or constructing one, and whatever you are estimating, the route is the same five steps. The calculator above performs them and shows each with your own numbers.
- Compute the point estimate. The sample mean, the sample proportion, the difference between two estimates, the sample correlation — whatever single number best summarises the quantity you care about.
- Compute its standard error. Not the standard deviation of the data: the standard deviation of the estimate. For a mean it is s/√n; for a proportion it involves p̂(1−p̂)/n; for a difference the two contributions add as variances.
- Choose the confidence level and get the critical value. A 95% level means α = 0.05 and α/2 = 0.025 in each tail. Take the critical value from the distribution that matches your situation: Student’s t when the spread is estimated, the standard normal when σ is known, chi-square for a variance, and so on.
- Multiply to get the margin of error. Margin of error = critical value × standard error.
- Add and subtract. The confidence limits are the estimate minus the margin of error (lower bound) and the estimate plus it (upper bound). Where the sampling distribution is skewed — a proportion, a variance, a correlation, a count — steps 4 and 5 are replaced by inverting the distribution directly, which is why those intervals are not symmetric about the estimate.
How to construct a confidence interval for a population mean μ
This is the classic exercise, and it has one decision point that determines everything else. Work it through with a sample of n = 25 measurements whose mean is x̄ = 72 and whose sample standard deviation is s = 10, at 95% confidence.
- State the parameter. You are estimating μ, the mean of the population the sample came from — not the sample mean, which you already know exactly.
- Decide: is the standard deviation known or estimated? Here s = 10 was computed from the sample, so it is an estimate. That means Student’s t, with df = n − 1 = 24. If instead a known population σ = 10 had been given in advance, the standard normal would apply and df would not exist.
- Standard error. SE = s/√n = 10/√25 = 2.
- Critical value. α = 0.05, so α/2 = 0.025 in each tail, and t*(0.975, 24) = 2.0638985616.
- Margin of error. 2.0638985616 × 2 = 4.1277971233.
- Confidence limits. 72 − 4.1277971233 = 67.8722028767 and 72 + 4.1277971233 = 76.1277971233, so the 95% confidence interval for μ is [67.8722028767, 76.1277971233].
- State the conclusion in words. “We are 95% confident that the population mean lies between 67.87 and 76.13” — where “95% confident” refers to the procedure, as described above.
The one thing to check before writing that sentence: the interval assumes independent observations and a sampling distribution of the mean that is approximately normal. With n = 25 that is usually fine unless the data are strongly skewed or contain outliers.
Critical z values for common confidence levels
| Confidence level (1 − α) | α | α/2 per tail | Critical z* |
|---|---|---|---|
| 80% | 0.2 | 0.1 | 1.2815515655 |
| 90% | 0.1 | 0.05 | 1.6448536270 |
| 92% | 0.08 | 0.04 | 1.7506860713 |
| 95% | 0.05 | 0.025 | 1.9599639845 |
| 96% | 0.04 | 0.02 | 2.0537489106 |
| 97% | 0.03 | 0.015 | 2.1700903776 |
| 98% | 0.02 | 0.01 | 2.3263478740 |
| 99% | 0.01 | 0.005 | 2.5758293035 |
Read the table with the vocabulary straight, because these four columns are four different things:
- Confidence level (the confidence coefficient, 1 − α) is the long-run proportion of intervals that capture the parameter. You choose it — 90%, 95%, 99% — before looking at the data.
- α is what is left over: α = 1 − (confidence level as a proportion). At 95%, α = 0.05.
- α/2 is the probability placed in each tail of a two-sided interval, because the interval excludes extreme values in both directions. At 95%, that is 0.025 per tail. A one-sided bound would put the whole α in one tail and use a different critical value.
- The critical value z* is the point on the standard normal scale with α/2 above it — the number you multiply the standard error by. It is not the confidence level and it is not a probability: for 95% confidence z* = 1.9599639845, often rounded to 1.96. It is a z-score — a position on the standard normal scale — which is why a “z value for a 95% confidence interval” and a “90% confidence interval z score” both mean this column.
Every value in the table is computed by this page’s engine from the inverse normal CDF, not copied from a printed table. Use these z values only when the standard normal is the right distribution — for a mean with an estimated standard deviation you need a t value with n − 1 degrees of freedom instead, and the calculator supplies it.
Z vs t confidence intervals
The decision rule has one input, and it is not the sample size:
- Use Z when the population standard deviation σ is genuinely known in advance — from a specification, a calibrated instrument, or a well-established prior body of measurement — and is not computed from the data in front of you.
- Use t whenever the spread is estimated from the sample (s). The extra uncertainty of having estimated it is what the heavier tails of the t distribution account for, and the degrees of freedom n − 1 record how much information went into that estimate.
In practice, σ is almost never known, so t is almost always correct. It is a common mistake to switch to Z once n passes 30: with an estimated s, the correct distribution is still t. The reason the mistake is usually harmless is that t converges to Z as the degrees of freedom grow — but converging to something is not the same as being it, and the calculator uses the exact t value rather than an approximation.
| Situation | Distribution | Critical value | 95% interval |
|---|---|---|---|
| x̄ = 100, s = 15 (estimated), n = 10 | Student’s t, df 9 | 2.2621571628 | [89.2696464104, 110.7303535896] |
| x̄ = 100, σ = 15 (known), n = 10 | Standard normal | 1.9599639845 | [90.7030745154, 109.2969254846] |
| x̄ = 100, s = 15 (estimated), n = 200 | Student’s t, df 199 | 1.9719565443 | [97.908424233, 102.091575767] |
| x̄ = 100, σ = 15 (known), n = 200 | Standard normal | 1.9599639845 | [97.9211442635, 102.0788557365] |
At n = 10 the difference is substantial: the t interval is noticeably wider, and that extra width is the honest price of estimating the spread from ten observations. At n = 200 the two critical values differ in the second decimal place. s and σ are not the same quantity, and this page never treats them as interchangeable — which is why the summary-statistics form makes you say which one you have.
Why Wilson is usually better than Wald
The Wald interval for a proportion plugs the observed p̂ into the standard error, then adds and subtracts z·√(p̂(1−p̂)/n). Near the boundaries that estimate of the standard error is badly wrong, and the interval inherits the error. Take a real near-boundary case — 1 success in 20 trials — at 95% confidence:
| Data | Method | Interval | Width |
|---|---|---|---|
| x = 1, n = 20 | Wilson score | [0.0088814488, 0.2361311934] | 0.2272497446 |
| x = 1, n = 20 | Clopper–Pearson exact | [0.0012650895, 0.2487327628] | 0.2474676733 |
| x = 1, n = 20 | Wald | [-0.0455168294, 0.1455168294] | 0.1910336588 |
| x = 0, n = 20 | Wilson score | [0, 0.1611251581] | 0.1611251581 |
| x = 0, n = 20 | Wald | [0, 0] | 0 |
Two things stand out. First, the Wald lower bound for x = 1 is negative: a proportion cannot be negative, so part of the interval is impossible. Second, at x = 0 the Wald standard error is exactly zero, so the interval collapses to the single point 0 and claims perfect certainty that the true proportion is zero — from twenty observations. Wilson, which inverts the score test instead of plugging in p̂, gives a bounded interval in both cases, and the exact Clopper–Pearson interval agrees with it closely while being slightly wider by design.
Coverage studies of the binomial interval (Brown, Cai and DasGupta, 2001, listed in the sources) show the same failure across a wide grid of n and p: nominal 95% Wald coverage can drop far below 95%, and the shortfall does not reliably improve as n grows. That is why Wilson is this page’s default, why Clopper–Pearson is offered when guaranteed coverage matters, and why Wald is present only as a labelled comparison that is never selected for you.
90% vs 95% vs 99% confidence intervals
Higher confidence does not mean a better estimate. On exactly the same data — mean 72, s = 10, n = 25 — raising the confidence level only widens the interval:
| Confidence level | t* | Margin of error | Interval | Width |
|---|---|---|---|---|
| 90% | 1.7108820799 | 3.4217641598 | [68.5782358402, 75.4217641598] | 6.8435283196 |
| 95% | 2.0638985616 | 4.1277971233 | [67.8722028767, 76.1277971233] | 8.2555942465 |
| 99% | 2.7969395048 | 5.5938790095 | [66.4061209905, 77.5938790095] | 11.1877580191 |
The trade is explicit: a 99% interval captures the parameter more often in the long run, and it pays for that by being less informative about where the parameter is. A 99% interval is not more precise than a 95% interval on the same data — it is less precise. Precision is width, and width comes down only by collecting more data, reducing measurement variability, or accepting a lower confidence level. Choosing the level after seeing which one gives the answer you wanted also invalidates the coverage guarantee; pick it before you look.
| Sample size | Standard error | Margin of error | Width |
|---|---|---|---|
| n = 10 | 3.1622776602 | 7.1535690597 | 14.3071381194 |
| n = 25 | 2 | 4.1277971233 | 8.2555942465 |
| n = 100 | 1 | 1.9842169516 | 3.9684339032 |
| n = 400 | 0.5 | 0.982963648 | 1.9659272959 |
Width shrinks with 1/√n, so cutting the margin of error in half takes roughly four times as much data, and cutting it to a quarter takes about sixteen times as much. Note what a bigger sample does not do: it does not remove bias. A narrow interval around a badly sampled estimate is a precise answer to the wrong question.
Confidence level vs confidence interval vs margin of error
These three are routinely used as if they were the same thing. They are not, and the difference is mathematical, not stylistic.
| Term | What it is | Where it comes from | Example |
|---|---|---|---|
| Confidence level | A probability you choose in advance — the long-run coverage of the procedure, also called the confidence coefficient 1 − α | Your decision; it fixes α and therefore the critical value | 95% |
| Margin of error | Half the width of a symmetric interval: critical value × standard error | Computed from the data and the chosen level | ±4.1277971233 |
| Confidence interval | The pair of limits themselves — the whole range of plausible values | Point estimate ± margin of error, or inversion of the sampling distribution | [67.8722028767, 76.1277971233] |
One consequence worth stating: intervals that are not symmetric — Wilson, Clopper–Pearson, chi-square for a variance, Fisher z for a correlation, exact Poisson for a count — have a width but no single margin of error, because the distance to the lower limit differs from the distance to the upper limit. The result card above omits the margin-of-error row for those methods rather than printing half the width and calling it something it is not.
Confidence limits, lower bound and upper bound
The two numbers that define a confidence interval are its confidence limits. The smaller one is the lower confidence limit — the lower bound — and the larger one is the upper confidence limit, or upper bound. “Confidence limits”, “confidence bounds” and “the endpoints of the interval” all name the same pair; the interval is everything between them.
Two practical notes. First, a two-sided interval splits α between the tails, so each limit carries α/2; a one-sided bound puts the whole α in one tail and is therefore closer to the estimate than the corresponding two-sided limit. Report which one you computed — this page computes two-sided intervals. Second, a limit is a plausible value like any other inside the interval, not a maximum or minimum the parameter cannot exceed. The upper limit is not a worst case; it is where the interval stops.
Point estimate and interval estimate
A point estimate is a single best guess: the sample mean for μ, the sample proportion for p, the difference of two means for μ₁ − μ₂. It is easy to state and carries no information about how far off it might be. An interval estimate attaches that missing information by reporting a range together with the procedure’s coverage.
For a symmetric interval the point estimate sits exactly at the midpoint, which is why you can recover it from published limits by averaging them. For Wilson, Clopper–Pearson, chi-square and Fisher-z intervals the estimate is not the midpoint — the interval is deliberately pulled toward the middle of the parameter space or stretched by the transformation. The “Reverse a confidence interval” mode above returns the midpoint, half-width and width and says plainly which of those equal the published quantities and which do not.
Confidence interval vs standard error
The standard error is the estimated standard deviation of a statistic: how much the sample mean, or the sample proportion, would vary from sample to sample. It is one number. The confidence interval is built from it — critical value × standard error gives the margin of error — but they are not synonyms and they are not interchangeable in a report.
Quoting “estimate ± 1 SE” is roughly a 68% interval for a mean, not a 95% one; “± 2 SE” is approximately 95% only when the degrees of freedom are large, and is noticeably too narrow at small n where t* exceeds 2. Error bars on a chart are ambiguous unless you say which they are: ±1 SE, a 95% CI and ±1 standard deviation of the raw data are three different lengths on the same axis, and only the last describes the spread of individual observations rather than the uncertainty of an estimate.
Confidence interval vs prediction interval
A confidence interval covers a parameter — the population mean, say. A prediction interval covers a single future observation drawn from the same population. The prediction interval is always wider, because it must carry both the uncertainty about the mean and the natural spread of individual values: its standard error is s·√(1 + 1/n) rather than s/√n, which does not shrink toward zero as n grows.
So a 95% confidence interval for the mean height of a population may be a couple of centimetres wide with a large sample, while a 95% prediction interval for the height of the next person sampled remains tens of centimetres wide no matter how much data you collect. This page computes confidence intervals; if you need to say where the next observation will fall, a confidence interval is the wrong tool.
Confidence interval vs hypothesis test
The two are duals. For the standard two-sided test at significance level α, a null value falls outside the (1 − α) confidence interval exactly when the test rejects that null at level α. So a 95% interval for a difference that excludes 0 corresponds to a two-sided test rejecting “no difference” at the 5% level, and an interval that includes 0 corresponds to not rejecting.
The interval carries strictly more information, which is why it is the better default report: it shows the whole range of null values that would not be rejected, and it does so on the scale of the quantity you measured. A test returns a verdict; an interval returns a magnitude with its uncertainty attached. That is also why the number line above marks zero without labelling anything “statistically significant” — the phrase adds a threshold decision to a picture that already shows the evidence, and this page is not a p-value calculator.
One caution that applies to both: an interval excluding zero says the data are inconsistent with no effect at that confidence level. It says nothing about whether the effect is large enough to matter, which is a subject-matter judgement.
Confidence interval and standard deviation
Standard deviation and confidence intervals answer different questions, and mixing them up is the most common source of confusion on this page’s topic.
- Standard deviation describes the data. It measures how far individual observations sit from their mean, in the units of the measurement. Collect more data and it settles toward the population value; it does not shrink.
- A confidence interval describes an estimate. Its width is driven by the standard error s/√n, which does shrink as n grows. Two studies with identical standard deviations produce very different interval widths if their sample sizes differ.
The standard deviation is nevertheless an input to the interval: for a mean, s enters through the standard error, and s is computed with the n − 1 denominator. If you need to compute s itself from a data set — with the sample-versus-population denominator stated explicitly and a full working table — use the dedicated Standard Deviation Calculator; this page then takes that s, an n and a confidence level and turns them into an interval. And if the population standard deviation is itself the thing you want an interval for, use this page’s “Standard deviation / variance” mode, which uses the chi-square pivot and is genuinely sensitive to non-normality.
Confidence interval for a proportion
When the outcome is binary — yes/no, converted/not, defective/sound — the population quantity is a proportion p, and the data are a count of successes x out of n trials. The sampling model is the binomial, so no normality of raw data is required: the binomial already describes how a count varies.
What differs between methods is how the binomial is turned into limits. The Wilson score interval inverts the score test and is the default here: its coverage stays close to the nominal level even at small n and near the boundaries, and its bounds cannot leave [0, 1]. Clopper–Pearson inverts the exact binomial test, guaranteeing at least the nominal coverage at the cost of being conservative — the right choice when under-coverage would be unacceptable. Agresti–Coull adds z²/2 successes and failures before applying the Wald algebra, giving most of Wilson’s benefit in a hand-computable form. Jeffreys is the Bayesian equal-tailed interval from the Beta(½, ½) prior, and its interpretation is a credible interval rather than a frequentist one. Wald is included only so you can see what it does.
The workspace computes all five on your counts simultaneously and plots them, so the choice of method is visible rather than hidden. For a difference between two proportions the same logic applies one level up: the Newcombe hybrid builds the difference from the two groups’ Wilson intervals, which is why it inherits their good behaviour near 0 and 1.
How to find a confidence interval on a TI-84
On a TI-83/84 the confidence-interval routines live under STAT → TESTS. Navigate by command name rather than by menu number: the ordering and numbering differ between operating-system versions and between the TI-84 Plus and TI-84 Plus CE, so a number that is right on one calculator can select a different routine on another. The names below are stable.
- ZInterval — a mean when the population standard deviation σ is known. It asks for σ, and that is the tell: if you find yourself typing the sample standard deviation into the σ prompt, you are using the wrong routine.
- TInterval — a mean when the standard deviation is estimated from the sample. This is the one for almost all real data. It accepts either a list (Data) or x̄, s and n (Stats).
- 2-SampTInt — a difference between two independent means. Answer No to the “Pooled” prompt unless you have a specific reason to assume equal population variances; No gives the Welch interval, which is this page’s default too.
- 1-PropZInt — a single proportion, from x and n. Note that this computes the Wald-style interval, so for small samples or proportions near 0 or 1 it will differ from the Wilson interval this page reports; the comparison table above shows by how much.
- 2-PropZInt — a difference between two proportions, again a Wald-style interval rather than Newcombe’s.
Each routine asks for the confidence level as a decimal — enter .95, not 95 — and then displays the interval in the form (lower, upper) along with the statistics it used. Cross-check the result against this page: identical inputs should give identical bounds for ZInterval and TInterval, and the proportion routines should differ in the predictable direction just described.
How to write a confidence interval statement
A complete report names the parameter, the estimate, the level, the limits and the method. A workable template:
“The mean was 72 (95% CI [67.87, 76.13], Student’s t, n = 25).”
For a difference: “The difference between groups was −2.00 (95% CI [−3.58, −0.42], Welch’s t, ν = 36.82).” For a proportion: “52% reported the outcome (95% CI [42.3%, 61.5%], Wilson score, n = 100).” Use the Copy result button above to get these numbers at your chosen display precision; the “Reproduce this result” section gives the code that regenerates them.
Four rules that hold regardless of house style:
- Always state the confidence level. “CI [67.87, 76.13]” is incomplete — 90%, 95% and 99% intervals from the same data are all different.
- Always state the method when more than one is plausible, which is every proportion and every two-group comparison.
- Report the interval alongside the estimate, not instead of it, and keep both to the same number of decimal places.
- Do not write it as a probability about the parameter. “We are 95% confident that…” is standard; “there is a 95% probability that μ is between…” is not what a frequentist interval says.
Individual journals and style guides impose their own formatting — decimal places, whether to write “95% CI” or “95 % CI”, comma versus en dash between limits. Follow whichever applies to you; this page does not claim to reproduce any particular one.
Common confidence interval mistakes
- Reading the interval as a probability about the parameter. Claiming that the true mean has a 95% probability of lying inside this interval is the single most common error. The parameter is fixed; the interval is what varies across samples. The 95% is the long-run capture rate of the method.
- Treating a higher confidence level as greater precision. On the same data a 99% interval is wider than a 95% one. Higher confidence buys coverage by giving up precision; only more or better data buys both.
- Treating s as if it were σ. They are different quantities, and confusing them means using Z where t is required. The mistake understates the interval — most visibly at small n.
- Assuming a larger sample fixes everything. More data narrows the interval but does nothing about bias. A non-random sample, a leading question or a broken instrument produces a tight interval around the wrong number, and the interval will not warn you.
- Taking a narrow interval as proof of good sampling. Width reflects sample size and variability, not validity. Precision and accuracy are independent properties.
- Assuming normality is always required. It is not. Binomial and Poisson intervals assume a count model; t intervals rely on the sampling distribution of the mean, which the central limit theorem handles for reasonable n. The chi-square interval for a variance is the one that genuinely needs an approximately normal population — and it does not become robust as n grows.
- Using Wald for a proportion because it is the formula you were taught. Near 0 or 1, or at small n, its real coverage falls well short of the nominal level and its bounds can leave [0, 1] entirely.
- Analysing paired data as two independent samples. Pairing is a design feature; ignoring it throws away the variance reduction it was meant to buy and usually gives a needlessly wide interval.
- Choosing the confidence level after seeing the result. Selecting the level that makes an interval exclude zero destroys the coverage guarantee that made the interval meaningful.
- Reconstructing a sample size from published bounds. Bounds determine the midpoint, half-width and width, and nothing else. Anything more requires information the interval does not contain.
Worked examples for every mode
Every figure below is produced by the same engine that powers the calculator, at build time — none of them is a hand-written number that could drift out of step with the tool.
A mean from summary statistics
Twenty-five measurements average 72 with a sample standard deviation of 10.
Method: Student's t interval
95% CI = [67.8722028767, 76.1277971233], point estimate 72, critical value 2.0638985616, df 24.
A proportion (Wilson score)
52 of 100 respondents said yes.
Method: Wilson score
95% CI = [0.4231657777, 0.6153544824], point estimate 0.52, critical value 1.9599639845.
A difference between two independent means (Welch)
Two groups with unequal sizes and unequal spreads.
Method: Welch's t interval (unequal variances)
95% CI = [-3.5815815515, -0.4184184485], point estimate -2, critical value 2.0265183084, df 36.8245852094.
A difference between two proportions (Newcombe)
60 of 100 versus 45 of 100.
Method: Newcombe–Wilson hybrid score
95% CI = [0.0117239353, 0.280448521], point estimate 0.15, critical value 1.9599639845.
A paired mean difference
Sixteen before/after pairs improving by 3 on average, with a standard deviation of the differences of 4.
Method: Paired-sample Student's t interval
95% CI = [0.8685504544, 5.1314495456], point estimate 3, critical value 2.1314495456, df 15.
A standard deviation (chi-square)
The same 25 measurements, now estimating the population standard deviation itself.
Method: Chi-square interval for a variance
95% CI = [7.8082837022, 13.9115216751], point estimate 10, critical value 39.3640770266, df 24.
A correlation (Fisher z)
r = 0.6 from 30 pairs.
Method: Fisher z-transformation interval
95% CI = [0.3058420678, 0.7895901951], point estimate 0.6, critical value 1.9599639845.
A count / event rate (exact Poisson)
Five events observed in one unit of exposure.
Method: Exact Poisson (Garwood) interval via chi-square
95% CI = [1.6234863901, 11.6683320793], point estimate 5, df 12.
Reverse a published interval
Only the midpoint, the half-width and the width are recoverable.
Method: Algebraic inversion of a symmetric interval
Midpoint 72, margin of error 4.1277971233, width 8.2555942466. Sample size, standard deviation and method: not identifiable.
Plan a sample size for a proportion
±5 percentage points at 95% confidence from a population of 20,000.
Method: Sample size for a proportion (normal approximation with finite population correction)
Required sample size n = 377.
Frequently asked questions
What is a confidence interval?
A confidence interval is a range of plausible values for an unknown population quantity — a mean, a proportion, a difference — computed from sample data. It is built by a procedure with a known long-run success rate: a 95% procedure produces intervals that capture the true value in 95% of repeated samples.
How do you calculate a 95% confidence interval?
Compute the point estimate, compute its standard error, multiply the standard error by the critical value for 95% confidence, and add and subtract that margin of error from the estimate. For a mean with an estimated standard deviation the critical value is t*(0.975, n−1); for a proportion the recommended method is the Wilson score interval, which does not have this simple ± form.
What does 95% confidence actually mean?
It describes the procedure, not the interval you are holding. If you repeated the whole study many times and built an interval each time, about 95% of those intervals would contain the true parameter. The parameter is a fixed number, so it is not correct to say there is a 95% probability that it lies inside this particular computed interval.
What is the difference between a confidence level and a confidence interval?
The confidence level is the percentage you choose in advance — 90%, 95%, 99% — which fixes the critical value. The confidence interval is the pair of numbers that comes out for your data. One is a setting; the other is a result.
What is the margin of error?
The margin of error is the half-width of a symmetric interval: critical value × standard error. The interval is the point estimate plus and minus that quantity. Intervals for proportions, variances and correlations are not symmetric, so they have a width but no single margin of error.
When should I use Z instead of t?
Use the standard normal (Z) only when the population standard deviation σ is genuinely known in advance and not estimated from your data. Whenever the spread comes from the sample — which is almost always — use Student's t with n−1 degrees of freedom. Large n does not change the rule; t simply converges toward Z.
Can I calculate a confidence interval from just the mean, standard deviation and sample size?
Yes. Those three numbers plus a confidence level are enough for a mean. Enter them in summary mode and state whether the standard deviation is a sample s or a known population σ — that single choice decides whether t or Z is used.
Can I paste raw data instead of summary statistics?
Yes. Switch the input mode to raw data and paste values separated by commas, spaces, tabs, semicolons or line breaks. The workspace computes n, the mean and the sample standard deviation itself, then builds the interval and shows a per-observation audit table.
Which method should I use for a proportion?
Use the Wilson score interval for general reporting; it is the default here. Use Clopper–Pearson when guaranteed coverage matters more than width. Agresti–Coull is a good hand-computable alternative, and Jeffreys is the Bayesian equal-tailed option. Wald is shown for comparison only.
Why is Wilson better than the Wald interval?
Wald plugs the observed proportion into the standard error, so its real coverage collapses when the sample is small or the proportion is near 0 or 1 — and its bounds can fall outside [0, 1] or, at 0 or 100% success, shrink to zero width. Wilson inverts the score test instead, keeps coverage close to the nominal level and always stays inside [0, 1].
Is a 99% confidence interval more precise than a 95% one?
No — it is wider on exactly the same data. Higher confidence buys a greater long-run capture rate by giving up precision. Only more data, or less variable data, makes an interval narrower without lowering the confidence level.
How does sample size affect the width of a confidence interval?
For a mean, the width shrinks in proportion to 1/√n, so quartering the width takes roughly sixteen times as much data. A larger sample narrows the interval but does not correct bias: a precise interval around a badly sampled estimate is still wrong.
Can a confidence interval contain negative numbers?
It can whenever the quantity itself can be negative — a difference between two means or two proportions, or a correlation. It cannot for a proportion, a variance or a standard deviation, which is one reason the Wald proportion interval, which sometimes produces negative bounds, is not recommended.
What assumptions does a confidence interval require?
It depends on the method, and normality is not a universal requirement. Every method assumes independent observations from a random sample. Student's t adds approximate normality of the sampling distribution of the mean; binomial and Poisson intervals assume a count model instead; the chi-square interval for a variance genuinely requires an approximately normal population and does not become robust as n grows.
What is the difference between a confidence interval and a prediction interval?
A confidence interval estimates a population parameter, such as the mean. A prediction interval covers where a single future observation is likely to fall, so it also carries the spread of individual values and is always wider. This page computes confidence intervals.
What is the difference between a confidence interval and a standard error?
The standard error is the estimated standard deviation of a statistic — one number describing how much the estimate would bounce around across samples. The confidence interval is built from it by multiplying by a critical value. They are related, not synonyms, and quoting ±1 SE is roughly a 68% interval, not a 95% one.
Can I work backwards from published bounds to the margin of error?
Yes, but only partly. From a lower and an upper bound you can recover the width, the half-width (the margin of error) and the midpoint. The sample size, the standard deviation and the method used are not identifiable from the bounds alone, and the reverse tool on this page reports them as such rather than guessing.
How large a sample do I need for a given margin of error?
For a proportion, n = z²·p(1−p)/E², rounded up. With no prior estimate use p = 0.5, which maximises the requirement and is therefore conservative; apply the finite population correction when you are sampling a closed population. The sample-size planner on this page does both.
Methodology and verification
Ten estimation modes run on one pure, dependency-free engine (confidence-interval-engine v1.0.0) that server-renders the default result and is inlined verbatim into the page, so the browser and the server run byte-identical math. Every distribution is derived from two primitives — the regularized incomplete gamma P(a,x) and the regularized incomplete beta I_x(a,b) — which give the normal, Student's t, chi-square and beta tails; each quantile is obtained by a bracketed, monotonic, convergence-bounded inversion that returns NUMERICAL_CONVERGENCE_FAILED rather than an unconverged iterate. A mean estimated from a sample standard deviation s uses Student's t; the standard normal is used only when the user declares a known population sigma, and s and sigma are never treated as interchangeable. A single proportion defaults to the Wilson score interval, with Clopper-Pearson (exact), Agresti-Coull and Jeffreys available and Wald offered for comparison only, never selected automatically. Two independent means default to Welch's t interval with Welch-Satterthwaite degrees of freedom; pooled t is an explicit advanced override. Two proportions default to the Newcombe hybrid score interval built from Wilson component intervals. Variance and standard deviation use the chi-square pivot, correlation uses the Fisher z transform, and counts use the exact Poisson (Garwood) interval. Nothing is rounded during computation; display precision is a formatting control only. Every result carries a round-trip verification receipt that re-evaluates the distribution's CDF at the computed critical value and reports the residual against a stated tolerance. All calculations run locally in the browser: no data, result or receipt is transmitted anywhere.
Engine: confidence-interval-engine v1.0.0 · Author: Ugo Candido · Last updated: · No external statistical library, CDN or remote service is used, and every calculation runs locally in this browser. Browse more tools on the Math page.
Sources
Methodological references for the definitions and for each non-obvious default on this page — the Wilson score interval, the Clopper–Pearson exact interval, Agresti–Coull, the coverage evidence behind the Wald warning, Welch and Satterthwaite, Newcombe, Agresti–Caffo, the Fisher transformation and the exact Poisson interval. These document the methods; they are not input datasets, and this page carries no third-party review.
- NIST/SEMATECH e-Handbook of Statistical Methods, §1.3.5.2 — Confidence limits for the mean
- NIST/SEMATECH e-Handbook of Statistical Methods, §7.2.2 — Confidence intervals for a proportion and for a mean
- E. B. Wilson, “Probable Inference, the Law of Succession, and Statistical Inference”, Journal of the American Statistical Association, Vol. 22, No. 158, 1927, pp. 209–212 — the score interval used as this page’s default for a proportion
- C. J. Clopper and E. S. Pearson, “The Use of Confidence or Fiducial Limits Illustrated in the Case of the Binomial”, Biometrika, Vol. 26, No. 4, 1934, pp. 404–413 — the exact binomial interval
- A. Agresti and B. A. Coull, “Approximate Is Better than ‘Exact’ for Interval Estimation of Binomial Proportions”, The American Statistician, Vol. 52, No. 2, 1998, pp. 119–126
- L. D. Brown, T. T. Cai and A. DasGupta, “Interval Estimation for a Binomial Proportion”, Statistical Science, Vol. 16, No. 2, 2001, pp. 101–133 — the coverage comparison behind the Wald warning on this page
- B. L. Welch, “The Generalization of ‘Student’s’ Problem when Several Different Population Variances are Involved”, Biometrika, Vol. 34, No. 1/2, 1947, pp. 28–35
- F. E. Satterthwaite, “An Approximate Distribution of Estimates of Variance Components”, Biometrics Bulletin, Vol. 2, No. 6, 1946, pp. 110–114 — the degrees-of-freedom approximation used with Welch’s interval
- R. G. Newcombe, “Interval Estimation for the Difference between Independent Proportions: Comparison of Eleven Methods”, Statistics in Medicine, Vol. 17, No. 8, 1998, pp. 873–890 — the hybrid score interval used here
- A. Agresti and B. Caffo, “Simple and Effective Confidence Intervals for Proportions and Differences of Proportions Result from Adding Two Successes and Two Failures”, The American Statistician, Vol. 54, No. 4, 2000, pp. 280–288
- R. A. Fisher, “Frequency Distribution of the Values of the Correlation Coefficient in Samples from an Indefinitely Large Population”, Biometrika, Vol. 10, No. 4, 1915, pp. 507–521 — the basis of the z transformation used for correlation
- F. Garwood, “Fiducial Limits for the Poisson Distribution”, Biometrika, Vol. 28, No. 3/4, 1936, pp. 437–442 — the exact Poisson interval used for counts and rates
- J. Neyman, “Outline of a Theory of Statistical Estimation Based on the Classical Theory of Probability”, Philosophical Transactions of the Royal Society A, Vol. 236, No. 767, 1937, pp. 333–380 — the repeated-sampling definition of confidence used throughout this page