Confidence Interval Calculator
Find a confidence interval for a mean or a proportion at any confidence level, from summary numbers or raw data, with the margin of error, standard error and critical t or z value, drawn on the sampling distribution.
How to Use
- Choose mean (summary numbers), mean from data (paste values) or proportion.
- Type the sample mean, standard deviation and size, the values themselves, or the successes and sample size.
- Set the confidence level, usually 90, 95 or 99 (%). For a mean, say whether σ is known (rare) or estimated from the sample.
- Read the interval, the margin of error and the critical value.
- The curve shows the sampling distribution of the estimate with the middle area shaded; the bar below is the interval.
Worked Example
A mean. 25 people average 50 with a standard deviation of 10. The standard error is 10 ÷ √25 = 2. With 24 degrees of freedom the 95% t value is 2.064, so the margin of error is 2.064 × 2 = 4.13 and the interval is 45.87 to 54.13.
A poll. 520 of 1,000 people say yes: p̂ = 0.52. SE = √(0.52 × 0.48 ÷ 1000) = 0.0158, and 1.96 × 0.0158 = 0.031, so the result is 52% ± 3.1 points. The Wilson interval is 48.9% to 55.1%.
The common mistake: using z for small samples. With n = 5, the 95% interval needs t = 2.776, not 1.96. Using z makes the interval about 30% too narrow, and it would miss the true mean far more than 5% of the time.
Show Work
Formulas
Neyman’s Intervals
Jerzy Neyman introduced confidence intervals in 1937, giving a way to state the uncertainty of an estimate without assigning probabilities to fixed unknowns. Gosset’s t distribution (1908) had already made small-sample intervals possible, and Edwin Bidwell Wilson proposed his score interval for proportions in 1927; it was largely ignored for decades until studies in the 1990s showed the textbook Wald interval often covers the truth far less often than claimed.
Today the interval is often preferred to a bare p-value, because it shows both whether an effect is likely real and how large it might be.
About This Calculator
This calculator builds confidence intervals for a mean, using t or z as appropriate, from summary statistics or raw data, and for a proportion with both the Wald and the more reliable Wilson interval. It works at any confidence level, shows the standard error, critical value and margin of error, and warns when a sample is too small for the Wald interval.
Everything runs in your browser; nothing is sent anywhere.
Related calculators: Sample Size Calculator, Statistics Calculator, and P-Value Calculator.
Frequently Asked Questions
What does a 95% confidence interval mean?
If you repeated the study many times and built an interval each time, about 95% of those intervals would contain the true value. It does not mean there is a 95% chance the true value is in this particular interval: the true value is fixed, and this interval either contains it or not.
How is the interval calculated?
Estimate ± critical value × standard error. For a mean with an estimated SD: x̄ ± t × s/√n. With x̄ = 50, s = 10 and n = 25, SE = 2, t (95%, 24 df) = 2.064, so the interval is 50 ± 4.13 = (45.87, 54.13).
When do I use t instead of z?
Use t whenever the standard deviation is estimated from the sample, which is almost always. It is wider than z for small samples to account for that extra uncertainty, and approaches z as n grows: t = 2.064 for n = 25, 1.984 for n = 100, against z = 1.960.
What is the margin of error in a poll?
Half the width of the interval for a proportion: z × √(p̂(1 − p̂)/n). A poll of 1,000 with 52% support has a 95% margin of error of ±3.1 points. The largest margin is at p̂ = 50%, which is why polls often quote ±1/√n ≈ ±3.2 points for n = 1,000.
What is the Wilson interval?
A better interval for proportions than the textbook p̂ ± z·SE (the Wald interval), especially when p̂ is near 0 or 1 or n is small. With 2 successes in 20, Wald gives (−0.03, 0.23), which includes impossible negative values; Wilson gives (0.028, 0.30).
How do I use the Confidence Interval Calculator?
Simply type your numbers and read the result, which refreshes the instant you change something. There is nothing to submit and nothing to wait for.
Do I need to install or sign up for anything?
Not at all — it runs in the browser with nothing to install and no account. After it loads once, it even works without an internet connection.
Is my information private?
Yes. Everything happens in your browser. Nothing you type is sent to a server or saved anywhere.
Common Use Cases
Survey means
25 people averaging 50 with SD 10: 95% CI (45.87, 54.13).
Polls
52% of 1,000 voters: ±3.1 points at 95%.
Lab work
Paste repeated measurements for the interval around their mean.
A/B results
48 conversions from 600 visitors: Wilson 95% CI 6.1% to 10.4%.
Small samples
With n = 5 the 95% t value is 2.776, not 1.96.
Last updated: