Zero-Defect Sample Size (c=0) Calculator
Test n = ln(1 − C) ÷ ln(1 − p) units, rounded up, and accept only if every one passes; a clean result then lets you state with confidence C that the true defect rate is below p. To show under 5% defective at 95% confidence that is 59 units. Allow one or more failures and the page solves the cumulative binomial instead, which always asks for more units. A second mode reads a test you have already run and tells you the defect rate the result can honestly support. AQL as a baseline percent defective: NIST/SEMATECH e-Handbook, lot acceptance sampling.
Treat this as an engineering estimate for sizing a test, never as a quote. The arithmetic sizes a pass/fail test; whether the parts, the fixture and the failure definition are right is a separate engineering call.

How this works
An attribute test sorts each unit into pass or fail. A latch clicks home or it does not; a seal lets dye through or holds; a board powers up or stays dark. Nothing is measured, so the only evidence is a count, and the practical question is how large that count must be before a clean result carries weight. Five units out of five passing says very little about a process that could be producing one bad part in twenty. Fifty-nine out of fifty-nine says something exact.
Where the zero-failure formula comes from. Assume the process really does turn out defective units at exactly the rate p you want to rule out, and that n units are drawn at random from a large population. Each unit passes with probability 1 − p, so all n pass with probability (1 − p)n. If that probability is small, a clean sample would be an unlikely event for such a process, and you can reject the idea that its rate is as high as p. Set the probability equal to 1 − C and solve for n. That is the success-run formula, written n = ln(1 − C)/ln(R) with R = 1 − p in Harish Jose's derivation for Quality Digest. Always round up: a fractional unit cannot be tested, and rounding down leaves the confidence slightly short of C.
What the inputs mean. The limit p is the line you want to prove the process sits under, as a share of units: 2% means two failing units per hundred. Confidence C is how sure you want to be, and 1 − C is the chance that a process sitting exactly on the limit would pass anyway through luck of the draw; in acceptance-sampling language it plays the part of the consumer's risk. The acceptance number c is how many failures the plan tolerates. Leave it at zero for a classic success run. A unit that fails any criterion written into the protocol counts as one failure, however many things are wrong with it.
Reading the chart. Since ln(1 − p) ≈ −p for small p, the sample grows roughly as 1/p: ruling out a rate ten times smaller costs about ten times the units. Confidence is cheaper. At a fixed 10% limit, going from 90% to 99% confidence moves the count from 22 to 44, because the numerator −ln(1 − C) rises only from 2.30 to 4.61. The same arithmetic sits behind the rule of three described on Wikipedia, which sets (1 − p)n = 0.05, rounds −ln 0.05 = 2.996 to 3, and lists 4.61 as the numerator for 99%.
Allowing failures: the binomial version
A zero-failure plan is unforgiving. One bad unit ends it, and the result can no longer support the claim it was designed for. Many teams therefore write in an acceptance number above zero, and the cost is a bigger sample. With c failures permitted, passing means seeing c or fewer, so the chance that a process sitting exactly at p passes is the cumulative binomial P(X ≤ c). The calculator searches for the smallest n that pushes that chance down to 1 − C. The Minitab blog post on reliability sample sizes gives the standard illustration: for a 95% confidence statement about 95% reliability, raising the acceptance number from 0 to 1 raises the sample from 59 to 93.
Why pay for those extra units? They do not give the buyer more protection; they give a good process a fairer hearing. Both plans in Figure 2 pass a process that is exactly 5% defective about 5% of the time, so both support the same claim. They part company at the low end, where a healthy process actually runs. A process at 1% defective passes the 59-unit zero-failure plan 55.3% of the time and the 93-unit one-failure plan 76.2% of the time (our binomial calculation). Put differently, with c = 0 a good but imperfect process fails close to half its validation runs, and with c = 1 roughly a quarter. Type an expected rate in the optional field and the calculator reports this pass chance for c = 0, 1 and 2 side by side.
Reading a test that has already run
The second mode turns the question around: n units were tested and c failed, so what defect rate can you honestly claim? The answer is the one-sided upper confidence bound, found by solving the binomial sum for p. The NIST/SEMATECH e-Handbook of Statistical Methods, section 7.2.4.1 sets out this exact binomial method for confidence limits on a proportion defective and works an example with 4 defectives in 20 units at 90% two-sided confidence, printing an upper limit of 0.401029. A two-sided 90% interval leaves 5% in each tail, so its upper end is also the one-sided 95% bound; our solver returns 0.401028, the same to five decimal places. With no failures the bound has a closed form, 1 − (1 − C)1/n, and the rule of three approximates it.
Worked example: a latch click check at 2%
A product team wants to show that fewer than 2% of a molded latch fail a functional click check, at 95% confidence, and expects the real process to run near 0.5%. The Load the worked example button fills in the plan inputs behind the first three blocks below; Read a test: 1 failure in 149 fills in the last.
The example shows the trade in plain numbers. The zero-failure plan is the smallest test that can make the 2% claim, yet a process running at a quarter of the limit fails it slightly more often than it passes. Allowing one failure costs 87 more units and lifts the pass chance to about two in three. And once a failure has occurred inside a c = 0 run, the honest reading is the read-mode bound for the units actually tested, here 3.14%. Deciding on c = 1 and 236 units after the failure is not the test that was designed, so settle the acceptance number before the first unit is checked.
Eight published values this page reproduces
| Case | Published value | This page |
|---|---|---|
| c = 0, 90% confidence, 90% reliability | 22 units (Jose, Quality Digest) | 22 (21.85 rounded up) |
| c = 0, 95% confidence, 95% reliability | 59 units (Jose, Quality Digest) | 59 (58.40) |
| c = 0, 95% confidence, 80% reliability | 14 by the success-run formula (Kyle Huston) | 14 (13.43) |
| c = 0, 99% confidence, 95% reliability | 90 pouches for a dye penetration check (Westpak calculator page) | 90 (89.78) |
| c = 1, 95% confidence, 95% reliability | 93 units (Minitab blog) | 93 (P = 0.04998; at 92, 0.0521) |
| 4 failures in 20, upper bound | 0.401029 at 90% two-sided (NIST e-Handbook 7.2.4.1) | 0.401028 at one-sided 95% |
| 10 failures in 100, lower bound on reliability at 95% | 0.836 (ReliaSoft example from Kececioglu) | 0.836 |
| 300 clean trials, 95% | under 1 in 100 by 3/n (Wikipedia, rule of three) | 0.994% exact |
Finite lots, and how the units are drawn
The binomial model treats every unit as an independent draw from a very large population. Jose's article notes that with a small finite lot the probabilities shift as units are removed, and the Minitab post describes these plans as c = 0 acceptance sampling with an infinite lot size. For a zero-failure plan the shift works in your favor. Drawing without replacement from N units of which D are defective, the chance of a clean sample is (N − D)/N × (N − D − 1)/(N − 1) × …, and every factor after the first is smaller than (N − D)/N, so the binomial count is enough and slightly more than strictly needed. The assumption that matters far more is randomness. The count only means something if every unit in the population had a chance of being picked, so draw across cavities, shifts, material lots and the full run rather than taking the first carton off the line.
Common mistakes
- Reading confidence as a yield. “95% confidence” describes the test, not the product. The product statement is the limit p; a protocol needs both numbers.
- Rounding down. 58.40 becomes 59, never 58. One unit short means the plan delivers a little less confidence than it claims.
- Testing units that do not represent production. Prototypes, hand-picked samples or the first shots after a setup are a different population from the parts customers receive.
- Changing c after a failure. The acceptance number is part of the design. Switching from c = 0 to c = 1 once a unit has failed quietly turns the test into a different one.
- Retesting a failure until it passes. Decide in the protocol whether a retest is allowed and how it is counted, before any data exist.
- Counting pass/fail when a measurement exists. If the characteristic is a dimension or a force, a capability study on the measured values (see the Cpk calculator) uses information a pass/fail count throws away.
Choosing between this test and the alternatives
| Method | Use it when | Limit |
|---|---|---|
| This calculator (success run and binomial) | You need one statement such as “below 2% at 95% confidence” from a pass/fail verification or validation run | Random sample, large population, one trial per unit; sizes a single claim, not a lot-by-lot scheme |
| AQL plan to ANSI/ASQ Z1.4 (AQL calculator) | Repeated incoming or outgoing lot inspection | Indexed to an AQL, which NIST calls the producer's base-line quality requirement (NIST e-Handbook), rather than to a confidence statement about a maximum rate |
| Lot-by-lot plans with an acceptance number of zero (our c = 0 explainer) | Zero-defect acceptance of incoming lots, often for the critical defect class | This page does not reproduce lot-by-lot c = 0 tables; the explainer covers how they are used |
| Capability study on measured data (Cpk calculator) | The characteristic can be gauged and the process is stable | Needs a stable, roughly normal process and a capable gauge (our reading) |
| Time- or cycle-based life test | Failures depend on hours, cycles or aging rather than a single go/no-go trial | Needs a life model; this page treats each unit as one trial |
Sources for the method. Exact binomial confidence limits on a proportion defective, with the 4-in-20 example: NIST/SEMATECH e-Handbook of Statistical Methods, 7.2.4.1 Confidence intervals. Success-run formula, the 22 and 59 examples and the finite-lot caveat: Harish Jose, Deriving the Success Run Theorem, Quality Digest, 2023. The 59-to-93 step for one allowed failure and the infinite-lot remark: Minitab Blog Editor, How Many Samples Do You Need to Be Confident Your Product Is Good?, 2017. The 14-unit example: Kyle Huston, Reliability and confidence from pass/fail data, 2021. The 90-pouch example: Westpak, sample size for attributes when c is zero. The 0.836 reliability bound: ReliaSoft reference example, non-parametric binomial reliability demonstration test. The 3/n shortcut and its numerators: Wikipedia, Rule of three (statistics). Every other figure here is our own arithmetic on those equations.
Reviewed by the JCH tooling team · updated November 2026.
Pass/fail sampling questions
How many parts with no failures show a defect rate under 1% at 95% confidence?
299. Divide ln(0.05) by ln(0.99) and you get 298.07, and a part count is always pushed up to the next whole number. Settle for 90% confidence and 230 parts are enough; ask for 99% and the count climbs to 459. The statement only stands if every one of those parts passes.
Why does allowing one failure make the test bigger?
A plan that tolerates a bad part still has to catch a process sitting right at your limit. Permitting one failure gives that process a second route to a pass, so extra parts are needed to drag its pass chance back down to 1 − C. The payoff is that a process genuinely better than the limit gets through more often, and that is the reason to choose it.
A part failed halfway through my zero-failure run. Can I keep going?
Not under the plan you started; a single failure has already settled it. What you can still do is report what the units support: switch to the read mode, type the count tested and the one failure, and quote that upper bound. If you want a plan that survives a failure, fix the acceptance number and the larger sample before testing begins and run that plan from the first unit.
Is 95/95 the same as 95% confidence and 5% defective?
Yes, in the usual shorthand the first figure is confidence and the second is reliability, which is one minus the defect rate. So 95/95 claims, with 95% confidence, that at least 95% of units conform, meaning fewer than 5% are defective; with zero failures that needs 59 units. Spell both figures out in a protocol, because the shorthand is easy to read the wrong way round.
Does the size of my lot change the sample size?
For a big lot or a continuing process, no: the binomial answer depends only on the limit and the confidence. For a small, closed lot the hypergeometric distribution would allow slightly fewer parts, since every good part pulled out raises the defective share of what remains. Sticking with the binomial count in that case leaves you a little on the safe side when no failures are allowed.
How is this different from an AQL sampling plan?
An ANSI/ASQ Z1.4 plan is built around an acceptable quality limit, a baseline percent defective for the supplier's product, and is applied lot after lot. This calculator starts at the opposite end: the worst rate you will tolerate and how certain you need to be that the product is better. Use the AQL tool for routine incoming or outgoing inspection, and this one for a single verification or validation claim.
What is the rule of three?
A quick approximation for the clean-sample case: after n trials with no failures, the 95% upper bound on the failure rate is roughly 3 divided by n. It holds because ln(0.05) is close to −3 and, for small rates, ln(1 − p) is close to −p. With 300 clean trials it gives 1%, against an exact 0.994%, so it slightly overstates the bound, more so for small samples, which errs toward caution.
Ask JCH about pass/fail test sizes
Planning a verification run, or trying to make sense of one that already finished? Type your question. Replies are drawn from pages on jchtrade.com; if you would like a person to follow up, say so in the question.
Automated replies drawn from this site. Confirm anything that matters with someone on our team before acting on it.
Writing a pass/fail validation plan for a new part?
Bring the drawing, the failure you are worried about and the claim your customer expects to see. We will work through the failure definition, the sample size and how units are drawn with you, so the protocol is agreed before the first part is checked.
Book a free 30-minute first consultation Share your test protocol