Complete guide
Use the calculator above to size pass/fail (attribute) samples for defect-rate confirmation and acceptance sampling. Includes zero-acceptance plans, proportion-estimation sizing and confidence intervals on observed defect rates — the standard toolkit for quality audits, supplier inspection and incoming-goods checks.
What it is
What is attribute sample size?
Attribute sample size answers the question "how many pass/fail items must I inspect to be sufficiently sure of the underlying defect rate?". It is the discrete counterpart to continuous-data sample-size calculations and is the standard approach for audits, supplier acceptance and conformity inspection.
Calculation logic
How the calculation works
For zero-acceptance: n = ln(1 − Confidence) ÷ ln(1 − AQL). For proportion estimation: n = (Z² × p(1−p)) ÷ E². For confidence on observed defects, the calculator uses exact binomial methods rather than the normal approximation, which matters when defect counts are small.
Common mistakes
Watch-outs before using attribute sample size
- Using continuous-data sample-size formulas on pass/fail data — they give the wrong answer.
- Picking a sample size by convention (n=30) without checking it meets the confidence requirement.
- Using the normal approximation on small defect counts — exact binomial methods are correct.
- Confusing AQL (acceptable quality level) with the actual defect rate — AQL is a planning input.
- Forgetting that zero defects in n samples is not proof of zero defect rate — it gives an upper confidence bound on the rate.
What to do next
Turn the result into action
Define your AQL and confidence requirement before sampling. Use zero-acceptance plans for critical attributes; use proportion-estimation sizing when you genuinely need to estimate the rate.
What is attribute sampling?
Sampling pass/fail (discrete) data, as opposed to continuous measurements. Each item is classified as conforming or defective, and the sample size depends on the defect rate you want to detect or confirm.
What is zero-acceptance sampling?
A plan in which any defect rejects the entire lot. It produces small sample sizes for a given confidence level and is the standard for critical-to-quality attributes.
What is AQL?
Acceptable Quality Level — the worst defect rate that should still routinely be accepted. It is a planning input, not a target.
How is attribute sample size different from continuous?
Continuous-data sampling uses standard deviation; attribute sampling uses defect rate (proportion). The formulas are different and the assumptions are too.
Can I use 30 as a default sample size?
No. 30 is a heuristic for continuous data, not attribute data. Attribute samples for low defect rates often need hundreds to give meaningful confidence.