Statistics & Probability

Proportion Confidence Interval and z-Test Calculator

Confidence interval and hypothesis test for one proportion or the difference of two, and the sample size needed.

Tool no.
ECT-P08
Rev
1.0
Updated
Oct 2026
Method
Normal approximation
How to use this calculator

Enter the number of successes (such as defective parts) and the sample size for each sample, the confidence level, and for a test the hypothesized proportion and the alternative.

Formulas

Intervalp̂ ± zα/2√(p̂(1 − p̂)/n)
Testz0 = (p̂ − p0)/√(p0(1 − p0)/n)
Two samplesz0 = (p̂1 − p̂2)/√(p̂(1 − p̂)(1/n1 + 1/n2)), pooled p̂
Sample sizen = (zα/2/E)² p(1 − p)

Worked example

13 defective in a sample of 300; is the defect rate below 5%? (Montgomery Example 9-10, one-sided)

  1. p̂ = 13/300 = 0.0433.
  2. z0 = (0.0433 − 0.05)/√(0.05 × 0.95/300) = −0.53.
  3. P = Φ(−0.53) = 0.298, so we fail to reject H₀: there isn’t evidence that the rate is below 5%.

Frequently asked questions

When does the normal approximation work?

When np and n(1 − p) are both at least about 5 (some books say 10). For smaller samples use the binomial distribution directly.

Why is the test pooled but the interval not?

Under H₀ the two proportions are equal, so the test uses one pooled estimate. The interval doesn’t assume they are equal.