What this calculator does
It computes the operating characteristic curve of a single attribute sampling plan — and everything that follows from it: the probability of accepting a lot at the AQL and at the RQL, the producer’s and consumer’s risks those probabilities imply, the average outgoing quality limit, and how much inspection the plan costs you per lot.
It does not select the plan. The code letters, inspection levels and master tables that map a lot size and an AQL to a sample size and acceptance number are the content of ISO 2859-1 and ANSI/ASQ Z1.4, and they are not reproduced here. Read n and Ac out of the standard your contract calls up — or negotiate them directly with your supplier — and enter them.
That division is deliberate, and it is also the more useful design. The tables give you a plan; they do not tell you what the plan does. Two plans carrying the same AQL label can have very different consumer’s risks, and it is the OC curve, not the label, that determines whether a bad lot gets through.
The formula
The OC function is the probability that a sample of n drawn from a lot of quality p contains no more than Ac defectives.
Binomial form (lot large compared with the sample):
Pa(p) = Σ(k = 0 .. Ac) C(n,k) · p^k · (1 − p)^(n − k)
Hypergeometric form (exact for a finite lot, D = round(p·N) defectives):
Pa(p) = Σ(k = 0 .. Ac) C(D,k) · C(N − D, n − k) / C(N,n)
N is the lot size, n the sample size, Ac the acceptance number, Re = Ac + 1 the rejection number, and p the incoming fraction defective.
Real inspection is sampling without replacement, so the hypergeometric is the exact model. Its variance is smaller than the binomial’s by the finite-population factor (N − n)/(N − 1), which makes the OC curve steeper — acceptance is higher than binomial for lots better than Ac/n and lower for lots worse than it. Once the sample is under about 10% of the lot the difference is negligible, which is why the binomial is the working form and why this tool switches models at n = 0.1 N.
From the OC curve:
α = 1 − Pa(AQL) producer's risk
β = Pa(RQL) consumer's risk
AOQ(p) = p · Pa(p) · (N − n)/N average outgoing quality
AOQL = max over p of AOQ(p)
ATI(p) = n + (1 − Pa(p)) · (N − n) average total inspection
The AOQ and ATI expressions assume rectifying inspection: rejected lots are screened 100% and their defectives removed or replaced, accepted lots ship with their unexamined N − n items as they are. Under that scheme the AOQL is a genuine guarantee — the worst long-run outgoing quality the plan can produce, whatever the supplier does. Without rectification, AOQ and ATI do not apply; the OC curve and the two risks still do.
The average sample number for a single, uncurtailed plan is just n — every sample is inspected in full. ATI is the figure that moves, and it is the one to quote when someone asks what sampling costs.
Reading the result
Sampling plans are designed by fixing two points on the OC curve: Pa ≈ 95% at the AQL and Pa ≈ 10% at the RQL. Those targets — 5% producer’s risk, 10% consumer’s risk — are conventions, not requirements. They are what this tool warns against, because a plan that misses them is usually a plan whose sample size was chosen for cost rather than for discrimination.
Two things are worth internalising:
Only the sample size sets discrimination. The acceptance number slides the curve left or right; the sample size controls how steeply it falls. If your consumer’s risk is too high, no adjustment to Ac will fix it — you need more sample. The ratio RQL/AQL a plan can separate is essentially fixed by n.
The AQL is not a target. It is the worst process average that will still be accepted routinely. A supplier who runs exactly at the AQL is having roughly 5% of their lots rejected, and that is by design. Treating the AQL as a permitted defect rate is the most common misuse of the whole scheme.
Ac = 0 plans deserve their own caution. They look strict and are popular in supplier agreements, but their OC curve has no shoulder: acceptance starts falling from the first fraction of a percent defective, so producer’s risk at any realistic AQL is severe and the plan rejects good lots at a high rate. If you want tighter protection, increase n rather than driving Ac to zero.
Typical values
Sample sizes step in a near-geometric series — 8, 13, 20, 32, 50, 80, 125, 200, 315, 500, 800, 1250 — and AQLs come from a preferred series running 0.010, 0.015, 0.025, 0.040, 0.065, 0.10 … up to 10 percent defective. AQLs below about 0.1% generally cannot be demonstrated by attribute sampling at all: the sample sizes required become absurd, and you have to move to a variables plan (ISO 3951) or to process control.
For orientation: a plan with n around 50 can separate an AQL near 0.65% from an RQL near 8%. To separate 0.65% from 2% you need several hundred units in the sample. That ratio, not the absolute level, is what drives cost.
Worked example
A lot of 3200 units. The contract calls up a plan with n = 50 and Ac = 1, an AQL of 0.65%, and names an RQL of 8.0%. The sample is 1.6% of the lot, so the binomial applies.
At the AQL, p = 0.0065:
P(0) = 0.9935^50 = 0.721761
P(1) = 50 × 0.0065 × 0.9935^49 = 0.236107
Pa = 0.721761 + 0.236107 = 0.957868 → 95.787%
α = 4.213%
At the RQL, p = 0.08:
P(0) = 0.92^50 = 0.015466
P(1) = 50 × 0.08 × 0.92^49 = 0.067246
Pa = 0.082712 → 8.271%
β = 8.271%
Both design conventions are met: α = 4.21% ≤ 5% and β = 8.27% ≤ 10%. The expected number of defectives in a sample drawn from an AQL-quality lot is 50 × 0.0065 = 0.325 — you will usually see none, occasionally one, and two is your signal to reject.
Outgoing quality, assuming rejected lots are screened:
AOQ(AQL) = 0.0065 × 0.957868 × 3150/3200 = 0.61289%
AOQL = 1.644%, reached when incoming quality is 3.18% defective
ATI(AQL) = 50 + 0.04213 × 3150 = 182.7 units inspected per lot
So the plan’s guarantee is this: however bad the supplier gets, the long-run average quality shipped downstream cannot exceed 1.64% defective, and it is worst — counter-intuitively — not when incoming quality is terrible but when it sits around 3.2%, bad enough to slip through the sample yet not bad enough to be caught and screened reliably. At an AQL-quality supplier the plan costs you 183 inspections per lot of 3200, against 3200 for 100% inspection.
FAQ
Why doesn’t this tool pick the sample size for me? Because the mapping from lot size, inspection level and AQL to a code letter and a plan is the copyrighted content of ISO 2859-1 and ANSI/ASQ Z1.4. Reproducing those tables would be republishing the standard. Read the plan from the standard you are contractually bound to, then use this tool to find out what it actually does — which the standard’s tables do not tell you.
What is the difference between RQL, LTPD and LQ?
Almost none. LTPD (lot tolerance percent defective, from Dodge & Romig) is conventionally the quality at which Pa = 10%; ISO 2859-1 calls it limiting quality. Enter whichever level you want protection against.
Does accepting a lot mean it meets the AQL?
No. It means the sample did not give you enough evidence to reject. A single lot at 5% defective still has a real chance of passing an n = 50, Ac = 1 plan. Acceptance sampling controls the average quality of a stream of lots; it says very little about any individual lot.
When should I use the hypergeometric model?
Whenever the sample is a meaningful fraction of the lot — the usual threshold is 10%. Below that the two models differ in the third decimal place. Above it the binomial understates how well the plan rejects bad lots, and for very small lots (say N under 100) it is simply the wrong distribution.
Can I use this for a double or sequential sampling plan? No. The OC function here is that of a single sampling plan. Double and multiple plans have their own OC and ASN functions, and their ASN is genuinely variable — which is the reason to use them.
This tool computes the statistical properties of the sampling plan you specify. It is not a conformity assessment and does not select plans. Plan selection, switching rules between normal, tightened and reduced inspection, and the associated acceptance criteria are defined in ISO 2859-1 and ANSI/ASQ Z1.4 and must be read from the standard applicable to your contract.