Quality & InspectionFree calculatorPDF, Excel, Word export

Upper Confidence Limit for Defect Rate Calculator

A clean sample does not mean a clean lot. Finding zero or two defects in a sample only tells you the true rate is probably below some ceiling. This calculator computes that ceiling, so your acceptance or supplier claim says what the data really supports.

Your numbers

pieces
pieces
units

Your results

Upper confidence limit on defect rate
4.7199
Wilson score bound in percent. You can say the true rate is below this value with the chosen confidence.
Worst-case defectives in the lot
236
Observed defect rate
1.6
One-sided z
1.6449
Upper limit in PPM
47,199
Exact bound if d = 0
2.3681
Only meaningful when no defectives were found. For d above zero use the Wilson result.

The Wilson score bound is an approximation that behaves well for small samples, but it is slightly less conservative than the exact Clopper-Pearson bound. Use exact methods for regulated claims.

Save results:

Upper confidence limit (%) vs sample size, same defects found

Sweeps Sample size n from 20 to 1000, holding your other inputs fixed.

Confidence-based supplier defect reporting

Optional: a review of how to report supplier quality with confidence limits from ERP lot data.

Optional. The tool and every export work without this. No spam.

How to use it

Enter how many pieces you inspected, how many defectives you found, and the confidence you want, usually 95 percent. The tool returns the observed rate, the upper confidence limit, the same limit in PPM, and the worst-case number of defectives in a lot of your size. The chart holds your defect count and sweeps the sample size so you can see how much more inspection would tighten the answer.

  • Use one-sided confidence when you only care about how bad the lot could be.
  • Count each defective piece once, not each defect on a piece.
  • Do not combine samples from different lots or conditions.

The math

The Wilson score upper bound for a proportion is (p + z squared over 2n + z x sqrt(p(1 - p)/n + z squared over 4n squared)) divided by (1 + z squared over n), where p = d/n and z is the one-sided normal value. It works at d = 0, unlike the plain normal approximation that collapses to zero. For zero defects the exact bound is 1 - (1 - confidence) raised to 1/n, which gives the familiar rule of three: about 3 divided by n at 95 percent.

Worked example

You inspect 125 pieces and find 2 defectives. The observed rate is 1.6 percent, but the 95 percent upper limit is about 4.7 percent. In a lot of 5000 that is up to roughly 236 defectives you cannot rule out. If you found none in 125, the exact bound is still about 2.4 percent. To demonstrate a limit below 1 percent with zero failures at 95 percent, you need about 299 pieces. The chart shows that returns diminish as the sample grows.

Common mistakes

Treating the observed rate as the lot rate is the classic error. So is claiming 'zero defects' from a small clean sample. Another is applying the formula to non-random samples, such as the first pieces off a run, which do not represent the lot. The result is only as good as the randomness of the sample.

Frequently Asked Questions

What does the upper confidence limit mean?

It is a ceiling on the true defect rate. At 95 percent confidence, you can say that if the same procedure were repeated many times, the true rate would be below the computed limit in about 95 percent of the cases.

Why not just use the observed rate?

A sample is only a slice of the lot. The same lot can give different counts on a different sample. The upper limit allows for that sampling noise, which matters most when counts are small.

What is the rule of three?

When you find zero defects in n pieces, the 95 percent upper limit on the defect rate is about 3 divided by n. For example zero defects in 300 pieces means you can only claim the rate is below about 1 percent.

Is Wilson accurate enough?

For most inspection decisions, yes. It is close to exact and much better than the simple normal formula. For legal or regulated claims, use the exact Clopper-Pearson interval in a statistics package.

If you want supplier defect claims and acceptance decisions backed by confidence limits straight from your ERP data, we can set that up. Ask for a short review.