Sample size and sampling plan calculator
Work out how many parts to inspect from a batch and how many defectives to accept per ISO 2859-1, or the sample size to estimate a proportion or a mean.
Inspecting a whole batch is expensive; a sample is inspected and a decision is made. The calculator does the two things most asked for: the attribute sampling plan of ISO 2859-1 (how many parts to inspect from a batch and with how many defectives it is accepted or rejected), with the real probability of acceptance, and the statistical sample size to estimate a proportion or a mean with a margin of error, both ways.
ISO 2859-1 sampling plan
- With the batch size and the inspection level (II is the normal one), table 1 gives a code letter.
- With the letter and the AQL (acceptance quality limit), table 2-A gives the sample size n and the acceptance Ac and rejection Re numbers. If the cell has an arrow, the first plan in its direction is used (with another sample size).
- n parts are inspected at random: with Ac defectives or fewer the batch is accepted; with Re or more, rejected.
| Batch size | Letter (level II) | n | AQL 1.0 | AQL 2.5 | AQL 4.0 |
|---|---|---|---|---|---|
| 91–150 | F | 20 | 0/1 (with 13) | 1/2 | 2/3 |
| 281–500 | H | 50 | 1/2 | 3/4 | 5/6 |
| 501–1200 | J | 80 | 2/3 | 5/6 | 7/8 |
| 1201–3200 | K | 125 | 3/4 | 7/8 | 10/11 |
| 3201–10,000 | L | 200 | 5/6 | 10/11 | 14/15 |
This is normal inspection with single sampling. The standard also has tightened and reduced inspection depending on the supplier's history, and double and multiple sampling.
Operating characteristic curve
A plan does not separate good from bad perfectly: the operating characteristic curve (the chart) gives the probability of accepting a batch according to its real percentage of defectives, with the binomial: Pa = Σ C(n,k)·pᵏ·(1−p)ⁿ⁻ᵏ for k = 0…Ac. A batch exactly at the AQL is almost always accepted; the «quality accepted only 10 % of the time» shows how much the plan protects the customer.
Sample size for estimating
z = 1.96 for 95 % and 2.576 for 99 %. Example: survey at 95 % with ± 5 % and p = 50 %: n = 384.2 → 385; if the population is 2000 people, 323.
Several ways to get each value
- Parts to inspect and when to accept, from the batch, level and AQL.
- The sample size to estimate a proportion or a mean with the margin you want.
- The margin your current sample gives: enter the sample size and leave the margin empty.
Frequently asked questions
How many parts do I inspect from a batch of 1000 with an AQL of 1.5?
With ISO 2859-1, level II: letter J, 80 parts; accept with 3 defectives or fewer and reject with 4 or more.
What is the AQL?
The acceptance quality limit: the worst percentage of defectives considered acceptable as an average. A batch exactly at the AQL is almost always accepted (around 90 to 99 %); with much more, it is rejected.
How is the sample size for a survey calculated?
n = z² · p(1 − p) / E². With 95 % confidence (z = 1.96), p = 50 % and ± 5 %: 1.96² · 0.25 / 0.05² = 384.2 → 385. With a population of 2000: 323.
Which inspection level should I use?
Level II is the normal one. Level I is used when less discrimination is enough and III when more is wanted. The special levels S-1 to S-4, when the test is costly or destructive and more risk is accepted.
