Confidence Interval Calculator

Calculate confidence intervals for population means and proportions. Enter your sample data and choose a confidence level (90%, 95%, or 99%) to get the confidence interval, margin of error, and critical values with step-by-step explanations.

95% Confidence Interval

[48.0400, 51.9600]

50.0000 ± 1.9600

Visual Representation

48.0450.0051.96

Margin of Error

±1.9600

Standard Error

1.0000

Critical Value (z)

1.960

Distribution

z (Normal)

Step-by-Step Solution

1. SE = σ / √n = 10 / √100 = 1.0000

2. z-score for 95% = 1.960

3. ME = 1.960 × 1.0000 = 1.9600

4. CI = 50 ± 1.9600

= [48.0400, 51.9600]

What Is a Confidence Interval?

A confidence interval (CI)is a range of values, derived from sample data, that is likely to contain the true value of an unknown population parameter. It provides a measure of uncertainty around a sample estimate. Instead of saying “the average is 50,” a confidence interval says “we are 95% confident the true average lies between 47.2 and 52.8.” This concept was formalized by Jerzy Neyman in 1937 and is foundational to inferential statistics.

How Are Confidence Intervals Calculated?

For a Population Mean

CI = x̄ ± z × (σ / √n)

  • = sample mean
  • z = critical value (1.96 for 95% confidence)
  • σ = standard deviation (population or sample)
  • n = sample size

For a Population Proportion

CI = p̂ ± z × √(p̂(1 − p̂) / n)

  • = sample proportion (successes / total)
  • z = critical value
  • n = sample size

Worked Example

A professor tests n = 36 students and finds a mean score of x̄ = 78 with a population standard deviation of σ = 12. At 95% confidence (z = 1.96):

  • Standard Error: SE = 12 / √36 = 12 / 6 = 2.0
  • Margin of Error: ME = 1.96 × 2.0 = 3.92
  • 95% CI: 78 ± 3.92 = [74.08, 81.92]

Interpretation: We are 95% confident the true population mean score lies between 74.08 and 81.92.

Understanding Your Results

The margin of error tells you the precision of your estimate — a smaller margin means more precision. It depends on three factors:

  • Confidence level: Higher confidence → wider interval → larger margin of error.
  • Sample size (n): Larger sample → narrower interval → smaller margin of error. The relationship follows √n, so quadrupling n halves the margin.
  • Variability (σ): More variability in the data → wider interval.

z-Distribution vs. t-Distribution

When the population standard deviation (σ) is known or the sample size is large (n ≥ 30), the z-distribution (standard normal) is used. When σ is unknown and n is small (< 30), the t-distribution is used instead. The t-distribution has heavier tails, producing wider intervals that account for the additional uncertainty of estimating σ from the sample. As degrees of freedom (df = n − 1) increase, the t-distribution approaches the z-distribution.

Critical Values Reference Table

Confidence Levelz-ScoreSignificance (α)Tail Area
90%1.6450.100.05 each tail
95%1.9600.050.025 each tail
99%2.5760.010.005 each tail

Common Misconceptions

  • Wrong: “There is a 95% probability that the true mean is in this interval.” The true mean is either in the interval or it isn't — it's not random.
  • Correct: “If we repeated this procedure many times, 95% of the resulting intervals would contain the true mean.”
  • Wrong: “A wider interval is better because it's more likely to contain the true value.” Width is a trade-off with precision — a CI of [0, infinity] is always “correct” but useless.

Real-World Applications

  • Political polling: “Candidate A leads with 52% ± 3% at 95% confidence.” The true support could be 49–55%.
  • Medical trials: “The drug reduced symptoms by 15% ± 4%.” If the CI includes 0%, the result is not statistically significant.
  • Quality control: “Average weight of cereal boxes: 500g ± 2g.” Ensures manufacturing stays within spec.
  • A/B testing: “Version B increased conversion by 3.2% [95% CI: 1.1%, 5.3%].” Since the CI doesn't include 0, the improvement is significant.

Sources and References

  • Neyman, J. (1937). “Outline of a theory of statistical estimation based on the classical theory of probability.” Philosophical Transactions of the Royal Society A, 236(767), 333–380.
  • Moore, D.S., McCabe, G.P., & Craig, B.A. (2017). Introduction to the Practice of Statistics (9th ed.). W.H. Freeman.
  • Agresti, A. & Coull, B.A. (1998). “Approximate is better than ‘exact’ for interval estimation of binomial proportions.” The American Statistician, 52(2), 119–126.
  • Student [Gosset, W.S.] (1908). “The probable error of a mean.” Biometrika, 6(1), 1–25.

Frequently Asked Questions

What is a confidence interval in simple terms?
A confidence interval is a range of values that is likely to contain the true population parameter based on sample data. For example, a 95% confidence interval of [48, 52] for average test scores means: if you repeated the sampling process 100 times, approximately 95 of those intervals would contain the true population mean. It does NOT mean there is a 95% probability that the true mean falls within this specific interval — the true mean either is or isn't in the interval. This is a common misconception clarified by Neyman (1937), who developed the confidence interval framework.
What is the difference between 90%, 95%, and 99% confidence levels?
The confidence level determines how wide your interval is. A 95% confidence level (the most common in research) uses a z-score of 1.96, producing a moderately wide interval. A 99% level (z = 2.576) produces a wider interval but offers greater confidence the true value is captured. A 90% level (z = 1.645) produces a narrower interval with less confidence. The trade-off is: higher confidence = wider interval = less precision. In medical research, 95% is standard; in preliminary studies, 90% is acceptable; and in high-stakes decisions, 99% is preferred.
When should I use a z-distribution vs. a t-distribution?
Use the z-distribution when: (1) the population standard deviation is known, or (2) the sample size is large (n ≥ 30). Use the t-distribution when: (1) the population standard deviation is unknown and you must estimate it from the sample, AND (2) the sample size is small (n < 30). The t-distribution has heavier tails than the z-distribution, producing wider confidence intervals for small samples. As n increases, the t-distribution converges to the z-distribution. William Sealy Gosset (publishing as 'Student') developed the t-distribution in 1908 while working at the Guinness brewery.
How does sample size affect the confidence interval?
The margin of error is inversely proportional to the square root of the sample size: ME = z × (σ/√n). Doubling the sample size reduces the margin of error by approximately 29% (not 50%). To cut the margin of error in half, you need to quadruple your sample size. This is why diminishing returns make very large samples expensive relative to accuracy gains. For example, going from n=100 to n=400 halves the margin of error, but going from n=400 to n=1600 only halves it again — with 4× the cost.
What is the margin of error and how is it calculated?
The margin of error (ME) is the radius of the confidence interval — the amount added to and subtracted from the sample statistic to create the interval. For means: ME = z × (σ/√n), where z is the critical value, σ is the standard deviation, and n is the sample size. For proportions: ME = z × √(p̂(1−p̂)/n), where p̂ is the sample proportion. A typical political poll with n=1,000 and p̂=0.50 at 95% confidence has ME = 1.96 × √(0.25/1000) = ±3.1 percentage points.
Can I calculate a confidence interval for proportions (percentages)?
Yes. This calculator supports both means and proportions. For proportions (like survey results or pass/fail rates), enter the number of successes and total sample size. The formula is: CI = p̂ ± z × √(p̂(1−p̂)/n), where p̂ = successes/n. This uses the Wald method, which is accurate for large samples (np̂ ≥ 5 and n(1−p̂) ≥ 5). For small samples, the Wilson score interval or Clopper-Pearson (exact) method is more reliable.

Related Tools