Confidence Interval Calculator
Find the confidence interval and margin of error for a sample mean or a proportion at any confidence level. It picks the right method automatically, z, Student's t, or the Wilson score interval, and shows every step so you can cite it. No signup, sources below.
How it works
A confidence interval puts a plausible range around a sample estimate. For a chosen confidence level C, the two-tailed tail area is α = 1 − C, split into α/2 in each tail. Every interval here has the same shape, point estimate ± (critical value × standard error), but the critical value and standard error change with the method, which the tool selects from your inputs.
Mean, population SD known (z-interval). When the population standard deviation σ is genuinely known, the standard error is SE = σ / √n and the critical value is the standard-normal quantile z = Φ⁻¹(1 − α/2) (1.96 at 95%). The interval is x̄ ± z·SE (NIST §1.3.5.2).
Mean, SD estimated (t-interval). When σ is estimated from the sample, the usual case, the standard error is SE = s / √n and the critical value is the Student's t quantile t = T⁻¹(1 − α/2, n − 1). This tool inverts the t distribution numerically through the regularized incomplete beta function, so any degrees of freedom resolve exactly rather than being read off a rounded table.
Proportion, Wilson score interval (default). With p̂ = x/n and z = Φ⁻¹(1 − α/2), the interval centres on (p̂ + z²/2n) / (1 + z²/n) with half-width [z/(1+z²/n)] · √(p̂(1−p̂)/n + z²/4n²), clamped to [0, 1] (Wilson 1927; NIST §8.4.1.3). Because it is asymmetric the tool shows both the Wilson centre and the sample p̂.
Proportion, Wald interval (optional). The simpler p̂ ± z·√(p̂(1−p̂)/n) is offered for comparison, with a warning: it under-covers and can leave [0, 1] when n is small or p̂ is near 0 or 1, which is exactly why Wilson is the default. As a built-in check, each critical value is pushed back through its own CDF to confirm it recovers the confidence level you asked for.
Worked examples
Frequently asked questions
Sources & references
- NIST/SEMATECH e-Handbook §1.3.5.2: Confidence Limits for the Mean (z and t)
- NIST/SEMATECH e-Handbook §7.2.4: Confidence Interval on a Proportion
- E. B. Wilson (1927), Probable Inference… JASA 22(158):209–212: the Wilson score interval
- Abramowitz & Stegun, Handbook of Mathematical Functions §26.5, §26.7 (incomplete beta, Student's t)
The z, t and Wilson formulas on this page were last cross-checked against the NIST e-Handbook on 2026-06-11. Critical values are computed numerically (Acklam's inverse-normal approximation for Φ⁻¹; incomplete-beta inversion for the t quantile), so any confidence level and degrees of freedom resolve exactly to the displayed precision.
Related tools
Comments & feedback
Spotted a bug or want an improvement? Tell us, our team reviews every comment, and good ideas get built. Comments are public and anonymous.
Found a bug, edge case, or want to suggest an improvement?
Email me at [email protected] , most fixes ship within 24 hours.