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
Your results
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.
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.
Related Tools
Zero-Failure Reliability Demonstration Sample Size Calculator
Find the number of units that must survive a test with no failures to claim a reliability level at a chosen confidence, and the total test effort.
SAPSAP QM Zero Acceptance Sample Size Calculator
Find how many units to inspect when the rule is accept on zero defects, for a given lot size, LTPD and consumer risk.
Quality & InspectionAOQ and AOQL Rectifying Inspection Calculator
Find the average outgoing quality and the worst-case AOQL of a single sampling plan when rejected lots are 100 percent screened.
Quality & InspectionSample Size to Estimate a Mean Dimension Calculator
Find the number of pieces to measure so the lot average is known within a given margin at a chosen confidence level.
More Quality & Inspection tools
See all- SAP QM Process Capability Cp Cpk Calculator
- SAP QM Lot Rejection Rate, PPM and Sigma Level Calculator
- SAP QM Gauge R&R Study Calculator
- SAP QM Cp and Cpk Capability Calculator
- Job Shop Material Certification Log Worksheet
- Job Shop First Piece Inspection Sign-Off Template
- Job Shop Scrap and Rework Cost Calculator
- Master Data Audit Sample Size Calculator
- Data Quality Sigma Level Calculator