# AQL Sample Size Calculator (ANSI/ASQ Z1.4)

> Source: https://netray.co/tools/aql-sample-size-calculator-ansi-z1-4
> Publisher: Netray (netray.co), AI and integration engineering for ERP and manufacturing systems.
> Section: Free Tools

## Short answer

Find the Z1.4 sample size code letter and single sampling sample size for a lot, then see how likely the lot is to be accepted at a given defect rate.

## Category

quality

## Industry

Discrete Manufacturing

## Audience

- Quality inspector
- Incoming inspection
- Supplier quality engineer

## Tool

**Kind:** calculator

**Inputs:**

#### Lot size

**Key:** lot

**Type:** number

**Default:** 2500

**Min:** 2

**Step:** 50

**Unit:** pcs

**Help:** Number of units in the lot or shipment being inspected.

#### General inspection level

**Key:** level

**Type:** select

**Default:** 2

**Options:**

##### Level I (reduced discrimination)

**Value:** 1

##### Level II (normal, default)

**Value:** 2

##### Level III (increased discrimination)

**Value:** 3

**Help:** Level II is used unless the contract or your quality plan says otherwise.

#### Acceptance number (Ac) from Table II-A

**Key:** ac

**Type:** select

**Default:** 5

**Options:**

##### 0

**Value:** 0

##### 1

**Value:** 1

##### 2

**Value:** 2

##### 3

**Value:** 3

##### 5

**Value:** 5

##### 7

**Value:** 7

##### 10

**Value:** 10

**Help:** Read the Ac for your AQL and code letter from the standard. It is used here only to estimate the acceptance probability.

#### True lot defect rate

**Key:** defect_pct

**Type:** number

**Default:** 2.5

**Min:** 0

**Max:** 50

**Step:** 0.1

**Unit:** %

**Help:** The real percentage of nonconforming units in the lot, if you knew it.

**Outputs:**

#### Lot size band (0 = 2 to 8 units, 14 = over 500,000)

**Key:** idx

**Expr:** gte(lot,9)+gte(lot,16)+gte(lot,26)+gte(lot,51)+gte(lot,91)+gte(lot,151)+gte(lot,281)+gte(lot,501)+gte(lot,1201)+gte(lot,3201)+gte(lot,10001)+gte(lot,35001)+gte(lot,150001)+gte(lot,500001)

**Format:** integer

#### Code letter position (A=1, B=2, C=3, D=4, E=5, F=6, G=7, H=8, J=9, K=10, L=11, M=12, N=13, P=14, Q=15, R=16)

**Key:** ord

**Expr:** 1 + if(eq(level,2), idx, if(eq(level,3), idx + 1, if(gte(idx,4), idx - 2, if(eq(idx,3), 2, if(eq(idx,2), 1, 0)))))

**Format:** integer

**Primary:** true

**Description:** Letters I and O are not used in the standard, so J follows H.

#### Table sample size for the code letter

**Key:** size

**Expr:** 2 + gte(ord,2)*1 + gte(ord,3)*2 + gte(ord,4)*3 + gte(ord,5)*5 + gte(ord,6)*7 + gte(ord,7)*12 + gte(ord,8)*18 + gte(ord,9)*30 + gte(ord,10)*45 + gte(ord,11)*75 + gte(ord,12)*115 + gte(ord,13)*185 + gte(ord,14)*300 + gte(ord,15)*450 + gte(ord,16)*750

**Format:** integer

#### Sample size to inspect

**Key:** n

**Expr:** min(size, lot)

**Format:** integer

**Primary:** true

**Description:** If the table sample size is equal to or larger than the lot, inspect every unit.

#### Share of the lot inspected

**Key:** frac

**Expr:** if(gt(lot,0), n / lot * 100, 0)

**Format:** percent

#### Expected defects in sample (Poisson mean)

**Key:** m

**Expr:** n * defect_pct / 100

**Format:** decimal

#### Probability of accepting the lot

**Key:** pa

**Expr:** 100 * exp(0 - m) * (1 + gte(ac,1)*m + gte(ac,2)*pow(m,2)/2 + gte(ac,3)*pow(m,3)/6 + gte(ac,4)*pow(m,4)/24 + gte(ac,5)*pow(m,5)/120 + gte(ac,6)*pow(m,6)/720 + gte(ac,7)*pow(m,7)/5040 + gte(ac,8)*pow(m,8)/40320 + gte(ac,9)*pow(m,9)/362880 + gte(ac,10)*pow(m,10)/3628800)

**Format:** percent

**Description:** Poisson approximation of the OC curve for single sampling, normal inspection.

**Chart:**

#### Probability of acceptance vs true defect rate (%)

**Type:** line

**X:** defect_pct

**From:** 0.1

**To:** 10

**Steps:** 40

**Series:**

- pa

**Disclaimer:** Sample sizes follow ANSI/ASQ Z1.4 (ISO 2859-1) Table I for general inspection levels I, II and III with single sampling. Always read the accept and reject numbers from the standard itself. The acceptance probability is a Poisson approximation and is slightly optimistic for small lots.

## Content

**Intro:** ANSI/ASQ Z1.4 turns a lot size into a sample size in two steps: a code letter from Table I, then a sample size from that letter. This calculator does both and also estimates how likely a lot with a given defect rate is to pass.

**Sections:**

#### How to use the calculator

**Body:** Enter the lot size and choose the general inspection level. Level II is the default for most purchase orders. The calculator returns the code letter position, the table sample size and the number of units you actually inspect, which is capped at the lot size. Then look up your AQL and the code letter in Table II-A of the standard to find the acceptance number, choose that value in the Ac field, and try different true defect rates to see how the lot would behave. The chart shows the full operating characteristic curve for that plan.

**Bullets:**

- Level I samples less, Level III samples more, Level II sits between.
- Lot size is the size of the lot presented, not the size of the whole order.
- Draw the sample at random from the whole lot, not from the top of one pallet.

#### The method behind it

**Body:** Table I groups lot sizes into bands, for example 281 to 500, 501 to 1,200 and 1,201 to 3,200. Each band and level maps to a code letter from A to R, skipping I and O. Each letter maps to a fixed sample size: A is 2, B is 3, C is 5, D is 8, E is 13, F is 20, G is 32, H is 50, J is 80, K is 125, L is 200, M is 315, N is 500, P is 800, Q is 1,250 and R is 2,000. The AQL then sets the accept and reject numbers for that sample size. The OC curve here uses the Poisson approximation to the binomial.

#### How to read the result

**Body:** A lot of 2,500 units at Level II is code letter K, so you inspect 125 units. With Ac of 5 at a true defect rate of 2.5 percent the expected defects in the sample is about 3.1, and the lot is accepted most of the time. Raise the true defect rate to 6 percent and the acceptance probability falls sharply. That is the point of the plan: it is a screening tool that protects you from poor lots most of the time, not a guarantee that an accepted lot has zero defects.

#### Common mistakes

**Body:** The most common error is treating AQL as the maximum acceptable defect rate in a delivered lot. It is the quality level that the plan accepts most of the time. Other frequent errors are using the wrong lot size, forgetting to switch to tightened inspection after two of five consecutive lots are rejected, and mixing major and minor defects in one count. Define the AQL separately for critical, major and minor classes, and record which class each defect belongs to.

**Bullets:**

- Critical defects are normally inspected at an AQL of 0 or by 100 percent screening.
- Do not re-inspect a rejected lot until the failed units are removed or the supplier has sorted it.
- Record the plan used on every inspection report.

**Cta:** If your ERP already holds lot size, supplier and inspection history, we can wire sampling plan selection and switching rules into your receiving flow so the inspector sees the plan automatically.

**Faq:**

#### What is the sample size for a lot of 1,000 at AQL 1.0, Level II?

**Answer:** A lot of 1,000 falls in the 501 to 1,200 band, which is code letter J at Level II. J has a sample size of 80. For AQL 1.0 the single sampling normal plan accepts on 2 defects and rejects on 3. Confirm against Table II-A of your edition of the standard.

#### Is ANSI Z1.4 the same as ISO 2859-1?

**Answer:** They are technically aligned. ANSI/ASQ Z1.4 and ISO 2859-1 use the same code letters, sample sizes and accept and reject numbers for lot by lot inspection by attributes. Both descend from MIL-STD-105. Check the current edition your customer cites, since contracts sometimes reference a specific version.

#### What does it mean when the sample size equals the lot size?

**Answer:** In small lots the table sample size can be larger than the lot. The standard then calls for inspecting the entire lot, which is called 100 percent inspection. The calculator caps the sample at the lot size so you do not plan to inspect more units than exist.

#### Can I use this for variables data such as measured dimensions?

**Answer:** No. Z1.4 is for attributes, meaning pass or fail counts. Measured data uses a variables plan such as ANSI/ASQ Z1.9, which has different sample sizes and uses the sample mean and standard deviation. Many shops use Z1.4 for visual and go or no-go checks and Z1.9 or SPC for dimensions.

## Search terms

aql sample size calculator, ansi z1.4 sample size, aql calculator, aql sampling plan calculator, sample size code letter, acceptable quality limit calculator, iso 2859-1 sample size, aql inspection level ii

---
Talk to an engineer: https://netray.co/contact?intent=erp_ai | Machine catalog: https://netray.co/agent/catalog.json
