Home › Math & Science › Statistics › Confidence Interval
Confidence Interval Calculator
Calculate CIs for means or proportions — any confidence level, Z or T distribution, one or two-tailed.
Inputs
95% Confidence Interval
—
Enter values to calculate
Lower Bound
—
Upper Bound
—
Margin of Error
—
Standard Error
—
Critical Value (z)
—
Width of CI
—
SE = s/√nME = z* × SECI = x̄ ± ME
Sampling DistributionShaded region = acceptance zone · Tails = rejection zone
Plain-English Interpretation
Calculate an interval above to see the interpretation.
★ Sample Size Solver — How large does my sample need to be? ▾
Enter your desired margin of error and the standard deviation to find the minimum sample size needed.
Using current confidence level (CL)
n = —
Formula: n = ⌈(z* × σ / ME)²⌉
Sample Size Scenarios
See how CI width changes when sample size is halved or doubled.
Bear — Half n
n = —
ME = —
Width = —
Base — Current
n = —
ME = —
Width = —
Bull — Double n
n = —
ME = —
Width = —
Sensitivity Matrix — CI Width
Each cell shows CI width for a combination of n (rows) and confidence level (columns). Highlighted cell = your current inputs. Green = narrow, red = wide.
Calculate on the Calculator tab first.
Effect of Sample Size on CI Width
Highlighted bar = current n. Larger samples produce narrower intervals.
Your Interval in Plain English
Calculate a confidence interval on the Calculator tab to see the interpretation here.
Live CI Simulator — What Does 95% Really Mean?
Each horizontal line is a CI from a different sample drawn from the same population (μ = 50). Green = contains true μ. Red = misses it. Approximately CL% should be green.
❌
Common Mistake #1
“There is a 95% probability the true mean is in THIS interval.”
Correct: The true mean is fixed — it either is or isn't in this interval. The 95% refers to the long-run reliability of the method, not any single computed interval.
⚠️
Common Mistake #2
“A wider interval means worse precision.”
Correct: A wider interval actually gives you more confidence. The trade-off: higher CL (99%) = wider; lower CL (90%) = narrower but less certain. More precision = narrower = lower confidence or larger n.
ℹ️
Key Insight
“95% of individual data points lie in the CI.”
Correct: The CI is about the population mean, not individual values. For individual data, use a prediction interval instead, which is always wider than the CI.
Which Distribution Should I Use?
What are you estimating?
A proportion (p̂)
Always use Z
A mean (x̄)
Population σ known?
Yes
Use Z
No
n ≥ 30?
Yes
Z ≈ t (use either)
No
Use t (df = n−1)
Factors Affecting CI Width
⬆
Larger n
↔ Narrower CI
Width ∝ 1/√n — double n to reduce width by ~29%
⬆
Higher CL
↔ Wider CI
99% CI is ~31% wider than 95% CI for same data
⬇
Lower SD
↔ Narrower CI
Less variability → smaller SE → tighter interval
ℹ
One-Tailed
↔ Shorter bound
One-tailed CI has a smaller critical value than two-tailed
How to Use This Calculator
1
Choose Your Mode
Select Means (for a sample mean with standard deviation) or Proportions (for a survey percentage or rate).
2
Set Confidence Level & Tail
Choose 90%, 95%, 99% — or enter any custom level. Select two-tailed for a standard interval or one-tailed for a bound in one direction.
3
Read Results & Explore
The interval, margin of error, and chart update live. Use Scenario Analysis to see how n affects width, and the Interpretation tab to understand your results.
Formulas & Methodology
CI for Mean
x̄ ± z* × (s/√n)
z* from standard normal (or t* from t-distribution if n < 30 and σ unknown)
A range of values constructed so that a specified percentage of such intervals would contain the true population parameter if the study were repeated.
Confidence Level
The percentage (e.g., 95%) of confidence intervals that would contain the true parameter if you repeated the study many times under identical conditions.
Margin of Error (ME)
The half-width of the confidence interval; equals the critical value × standard error. Determines how precise your estimate is.
Standard Error (SE)
The standard deviation of the sampling distribution: SE = s/√n for means, √(p̂(1−p̂)/n) for proportions.
Critical Value (z* or t*)
The threshold beyond which observations are "unusual" under the null distribution. z* = 1.96 for 95% two-tailed; t* is slightly larger for small samples.
Real-World Examples
Example 1
Voter Poll (Proportion)
p̂ = 0.52, n = 1000, 95% two-tailed
CI = [0.489, 0.551] — margin of error ±3.1 percentage points
Upper CI = [−∞, 13.23] — confirms mean is below 13.23 with 95% confidence
Critical Values by Confidence Level
Confidence Level
z* (two-tailed)
z* (one-tailed)
Common Use
80%
1.282
0.842
Exploratory / low-stakes
90%
1.645
1.282
Business decisions, polls
95%
1.960
1.645
Standard (most science)
99%
2.576
2.326
Medical / safety-critical
99.9%
3.291
3.090
Quality control, Six Sigma
Related Calculators
Confidence Intervals: Quantifying Uncertainty
What a Confidence Interval Really Means
A 95% confidence interval does not mean there is a 95% probability that the true parameter lies within the specific interval you computed. Instead, it describes the performance of the procedure: if you repeated the same study 100 times, approximately 95 of the resulting intervals would contain the true value. Any single interval either contains the true value or it doesn't — the randomness is in the sampling, not the parameter.
When to Use Z vs T
Use the Z-distribution when the population standard deviation (σ) is known or when n is large (≥ 30). For small samples with unknown σ, the T-distribution accounts for the additional uncertainty by producing slightly wider intervals. The t critical values converge to z values as df increases — by df = 30, the difference is less than 1%.
Sample Size and Precision
The margin of error is proportional to 1/√n. To halve the margin of error, you must quadruple the sample size. This relationship explains why political polls survey roughly 1,000–1,500 people: beyond that point, the gains in precision diminish rapidly relative to the cost of additional data collection. The Sample Size Solver above shows exactly what n you need for any target margin of error.
Frequently Asked Questions
What does "95% confidence" mean exactly?
If you repeated your sampling procedure many times and computed a 95% confidence interval each time, about 95% of those intervals would contain the true population parameter. It describes the reliability of the method, not the probability for any single interval.
When should I use a t-interval instead of a z-interval?
Use a t-interval whenever the population standard deviation is unknown and your sample size is below 30. For n ≥ 30, the t and z critical values differ by less than 1%. This calculator switches automatically — check the "Critical Value" stat card to see which is being used.
How do I reduce my margin of error?
The most effective way is to increase sample size — but you must quadruple n to halve the margin of error. Alternatives: reduce measurement variability through better instruments or study design, or accept a lower confidence level. The Sample Size Solver above lets you enter a target ME and compute the required n.
What is the difference between one-tailed and two-tailed CIs?
A two-tailed CI gives both a lower and upper bound. A one-tailed CI (upper or lower) provides only one bound — the other is ±∞. One-tailed tests are used when you only care about deviations in one direction (e.g., "the defect rate is at most X").
When is the confidence interval for proportions not reliable?
The standard Z-interval for proportions requires n·p̂ ≥ 10 and n·(1-p̂) ≥ 10. When p̂ is near 0 or 1, or the sample is very small, the Wilson interval or the Agresti-Coull interval are more accurate. This calculator flags these cases with a warning.