Starlight Tools

Confidence Interval Calculator — Mean, Proportion & Difference

Calculate a two-sided confidence interval for one mean, one binomial proportion, two independent means, or two independent proportions. Results include the method, critical value, standard error, margin of error, assumptions, and calculation steps.

Sample summary

One population mean

Usually choose sample SD: the standard deviation of individual observations, not the standard error of the mean. Enter the mean and SD in the same measurement units.

Confidence level

Enter 95 for 95% confidence, not 0.95. Enter a value from 50 through 99.999.

Whether input values are transmitted, stored, or included in analytics requires engineering verification.

Confidence interval result

Your interval will appear here.
Choose a parameter, enter sample summaries, and calculate.

Confidence interval formulas and methods

ParameterMethodTwo-sided interval
Mean, unknown σOne-sample Student tx̄ ± t1−α/2,n−1 × s/√n. Formula reference: NIST/SEMATECH, confidence limits for a mean (source-f48533e2ea28c5134b0f2396c59d8aa8). Hypothetical worked example, separate from calculator output: n = 25, sample mean = 50 mm, sample SD = 10 mm, confidence = 95%. Population σ is unknown, so use Student t with 24 degrees of freedom. SE = 10/√25 = 2 mm; t critical value ≈ 2.063899. The interval is 50 ± 2.063899 × 2 = [45.872203, 54.127797] mm, rounded to [45.87, 54.13] mm. This estimates the population mean, not the range of individual measurements.
Mean, known σNormal zx̄ ± z1−α/2 × σ/√n. Use σ only when the population standard deviation is known independently; it is not the sample SD. Formula reference: NIST/SEMATECH, what confidence intervals are (source-13abf4b1fcfea2b4d1c424a6045ef415).
One proportionWilson scoreLet p̂ = x/n and z = z₁₋α/₂. The uncorrected Wilson interval is [c − h, c + h], where c = (p̂ + z²/(2n))/(1 + z²/n) and h = z × √(p̂(1 − p̂)/n + z²/(4n²))/(1 + z²/n). Its limits stay in [0, 1]. The alternative Wald interval is p̂ ± z × √(p̂(1 − p̂)/n); its limits are not clipped. For comparative evidence on score methods and coverage problems with simple proportion intervals, see Newcombe (1998), source-53e0d549d8fa20265e527aba391e1796. Hypothetical worked example, separate from calculator output: x = 40 successes in n = 100 trials, confidence = 95%. Choose Wilson; p̂ = 0.40 and z ≈ 1.959964. Substitution gives [0.309401, 0.497997], rounded to [30.94%, 49.80%]. This estimates the population success probability.
Difference in meansWelch t(x̄₁ − x̄₂) ± t1−α/2,ν × √(s₁²/n₁ + s₂²/n₂), where ν = (s₁²/n₁ + s₂²/n₂)² / ((s₁²/n₁)²/(n₁ − 1) + (s₂²/n₂)²/(n₂ − 1)). Retain the fractional degrees of freedom when finding the critical value. The estimate is group 1 minus group 2, in the common measurement units: positive means group 1 has the larger sample mean; negative means group 2 does. Hypothetical worked example, separate from calculator output: group 1 has n₁ = 25, mean = 50 mm, sample SD = 10 mm; group 2 has n₂ = 36, mean = 45 mm, sample SD = 12 mm. For independent groups at 95% confidence, choose Welch t without assuming equal variances. The estimate is 5 mm; SE = √(100/25 + 144/36) = √8 ≈ 2.828427 mm; ν ≈ 56.949153; t critical value ≈ 2.002504. The interval is [−0.663937, 10.663937] mm, rounded to [−0.66, 10.66] mm. It includes zero and differences in either direction; it does not prove the population means are equal.
Difference in proportionsNewcombe method 10Let d = p̂₁ − p̂₂ and let [L₁, U₁] and [L₂, U₂] be the uncorrected Wilson intervals for the two groups at the selected confidence level. Newcombe method 10 gives lower limit d − √((p̂₁ − L₁)² + (U₂ − p̂₂)²) and upper limit d + √((U₁ − p̂₁)² + (p̂₂ − L₂)²). The existing methodological reference is Newcombe (1998), source-f5a2ccde294123e2ff9d363c5bbf72f1; full-text formula verification remains a separate source-review task. The estimate is group 1 minus group 2: positive means the observed proportion is higher in group 1; negative means it is higher in group 2. Multiply a proportion difference by 100 to express percentage points, not relative percentage change. Hypothetical worked example, separate from calculator output: group 1 has 60 successes in 100 trials and group 2 has 40 successes in 100 trials. For independent groups at 95% confidence, choose Newcombe method 10. The Wilson intervals are approximately [0.502003, 0.690599] and [0.309401, 0.497997]. Combining their unrounded limits gives [0.061411, 0.328126], rounded to [6.14, 32.81] percentage points. The estimated difference is 20 percentage points; the interval is entirely positive. The relative increase from 40% to 60% is 50%, a different quantity that this interval does not estimate.

α is 1 minus the confidence level expressed as a fraction: at 95% confidence, α = 0.05. Here n is sample size, x̄ is sample mean, s is sample standard deviation, σ is known population standard deviation, x is the success count, and p̂ = x/n is the observed proportion. Subscripts 1 and 2 identify the groups. SE denotes standard error. The critical values z₁₋α/₂ and t₁₋α/₂,ν are the 1 − α/2 quantiles of the standard normal and Student t distributions; ν denotes degrees of freedom. Wilson uses center c and half-width h; L and U denote interval limits. Welch degrees of freedom use the Welch–Satterthwaite approximation. Wilson and Newcombe limits can be asymmetric, so the calculator reports separate distances from the estimate to each limit. The hypothetical examples were calculated independently of the managed calculator using the displayed formulas; intermediate values are shown approximately, and final limits are rounded only after calculation.

How to use the calculator

  1. Choose Mean, Proportion, or Difference.
  2. Enter summary statistics from one sample or two independent groups. For means, use the same measurement units for each mean and SD and across both groups. Enter the sample SD, not the standard error; for one mean, SE = s/√n. For proportions, successes and trials are whole-number counts, not percentages: for 40 successes in 100 trials, enter 40 and 100. Successes cannot exceed trials.
  3. Enter the confidence percentage as 95 for 95%, within the existing range of 50 through 99.999. For a mean, identify whether the SD is a sample estimate or known population σ; a large sample alone does not make σ known.
  4. Calculate and review the limits, method, standard error, critical value, assumptions, and graphic.
  5. Use Copy or Download CSV to save the result.

How to interpret the interval

A procedure with 95% coverage contains the true parameter in 95% of repeated samples under its model; approximate methods may differ from their nominal coverage. After one interval has been calculated, the parameter is fixed; avoid saying there is a 95% probability that it lies inside this particular frequentist interval. See NIST/SEMATECH, what confidence intervals are (source-13abf4b1fcfea2b4d1c424a6045ef415). For a difference, an interval containing zero includes no difference among the values compatible with the data under the method. It does not prove no effect or establish equivalence; consider the full interval and a defensible practical threshold.

Width reflects sampling uncertainty, not every source of error. Larger samples usually narrow intervals, while greater variability and higher confidence widen them. Bias, nonresponse, confounding, dependence, measurement error, and poor sampling are not repaired by a narrow interval.

Assumptions and limits

  • Observations and the two groups, where applicable, are independent. Clustered, repeated, matched, or paired data require methods that model that dependence.
  • Population interpretation requires a sample that represents the population of interest. The one-sample t interval has exact nominal coverage for independent observations from a normal population with unknown variance. Under departures from normality, coverage is approximate; larger samples often improve robustness, but severe skew and outliers still matter. Exact one-sample t coverage does not imply exact coverage for Welch's approximation. The one-sample formula and critical-value definition are given by NIST/SEMATECH, confidence limits for a mean (source-f48533e2ea28c5134b0f2396c59d8aa8).
  • Proportion intervals assume independent binary trials, a fixed number of trials, and a common success probability within each group. Difference intervals additionally require independent groups. Wilson and Newcombe intervals are approximate, not exact. Newcombe's single-proportion comparison documents coverage limitations and recommends score-based methods (source-53e0d549d8fa20265e527aba391e1796); the existing independent-proportions reference is source-f5a2ccde294123e2ff9d363c5bbf72f1.
  • The Wald proportion option is included for comparison and can have poor coverage or exceed 0%–100%; its displayed limits are not silently clipped.
  • For paired quantitative measurements, calculate one within-pair difference using a consistent direction, then use the Mean tab with the number of pairs, mean difference, and sample SD of the differences. Pairs must be independent of other pairs, and the one-sample mean assumptions apply to the differences. This workaround does not establish support for paired binary proportion comparisons.

Statistical limit: This calculator summarizes sampling uncertainty under the selected model. It does not establish causality, eliminate bias, assess study quality, or determine whether an effect is practically important.

Frequently asked questions

What does a 95% confidence interval mean?

Under repeated sampling, about 95% of intervals produced by the same procedure would contain the true parameter when the assumptions hold. It is not a 95% posterior probability for the fixed parameter.

Should I use z or t for a mean?

Use Student t when the population standard deviation is unknown and you enter the sample SD. Use z only when population σ is genuinely known or established independently.

Why is Wilson the default for a proportion?

The Wilson score interval usually has better coverage than the simple Wald interval, especially for smaller samples and estimates near 0 or 1, and its limits remain between 0 and 1.

What method is used for two independent means?

The Welch t interval. It does not assume equal variances and uses Welch–Satterthwaite degrees of freedom.

Can I use Difference for paired observations?

Not directly. For quantitative paired measurements with independent pairs, calculate one difference within every pair using a consistent direction. Use the Mean tab with the number of pairs and the mean and sample SD of those differences, subject to the one-sample mean assumptions. This does not establish support for paired binary proportion comparisons.

Why can a Wald proportion interval exceed 0% or 100%?

The Wald method is a symmetric normal approximation around the observed proportion and does not respect the parameter boundaries. Wilson is the recommended default.

Does a confidence interval prove practical importance?

No. Compare the interval with a defensible subject-matter threshold and consider design quality, measurement, bias, costs, and consequences.

Are my inputs tracked?

Input tracking has not been established by the evidence available for this draft. A separate engineering review is needed to determine whether entered values are transmitted, stored, or attached to analytics events. Browser-based calculation alone does not establish those privacy guarantees.

Methodology and references

Last reviewed: August 4, 2026. The recorded review states that the mean formulas and t critical-value definition were checked against NIST, and proportion method selection and difference-of-proportions construction against Newcombe's comparative studies. For this draft, the accessible NIST pages support the mean formulas and repeated-sampling interpretation; the accessible single-proportion abstract supports the comparative coverage discussion but does not display the detailed formulas. Separate source research is requested to check the explicit Wilson, Wald, and Newcombe method 10 formulas against the Newcombe full texts and to complete any remaining bibliographic gaps. The Welch degrees-of-freedom formula was checked against NIST's Two-Sample t-Test page linked from the existing mean reference; adding a dedicated source record requires a separate metadata task. Separate engineering verification is requested for input transmission, storage, and analytics behavior before restoring absolute privacy claims in blocks 31 and 38. Any corresponding structured-data answer requires a separate authorized review; no structured data or managed runtime is changed by these text edits.

Explore more tools