HuntsvilleEngineers mark

Sample Size (Binomial Proportion)

How many units to sample to estimate a pass/fail proportion within a target margin of error.

Inputn₀ = z²·p·(1−p) / E² , n = n₀ / (1 + (n₀−1)/N) (finite population correction)

Your recent runs (stored only in your browser)

No calculations yet — results land here so you can compare runs.

The engineering

This sizes a sample for estimating a binomial proportion — defect rate, yield, pass fraction — to within a chosen margin of error E at a stated confidence. The worst case is p = 0.5, which maximizes p(1−p); if you have no prior estimate, leave p at 0.5 and the result is conservative.

The margin E is absolute, not relative: E = 0.05 means ±5 percentage points, so a 2% defect rate estimated to ±5% is nearly useless. For rare events, either shrink E or expect large n. The finite-population correction only matters when your sample is a meaningful fraction of the lot — below ~5% it barely moves the number.

Sanity check: at 95% confidence (z ≈ 1.96), p = 0.5, E = 0.05, you get the textbook n ≈ 385. Halving E quadruples n.

Where this math comes from

The normal-approximation sample-size formula grew out of early 20th-century survey and agricultural work, but it was William G. Cochran who codified it for practitioners. His 1953 text Sampling Techniques laid out the n₀ = z²pq/E² form and the finite-population correction as the standard recipe, aimed squarely at people who had to actually plan surveys and field trials.

Cochran, a Scottish-born statistician who worked at Rothamsted with Fisher and Yates before moving to the US, spent his career translating heavy sampling theory into procedures engineers and biologists could follow. The formula on this card is essentially his — the same one that shows up on every QA sampling plan and political poll footnote.

  1. 1908William Sealy Gosset (Student)Small-sample theory that underpins confidence-based sizing.
  2. 1934Jerzy NeymanFormalizes confidence intervals, giving E and z their meaning.
  3. 1953William G. CochranSampling Techniques codifies n₀ = z²pq/E² and the finite-population correction.
  4. 1977Cochran (3rd ed.)Definitive edition that remains the standard reference for proportion sampling.

See the full timeline of the math behind every calculator →

Runs entirely in your browser — nothing you enter leaves this page. Your recent runs are stored only on your device.