Home Templates Calculators Videos Academy Software About Contact Login
Quality & Six Sigma

Attribute Sample Size Calculator

Calculate the sample size needed to detect or confirm defect rates for pass/fail data — with zero-acceptance sampling, proportion estimation, and observed-defects confidence interval analysis.

PDF Guide
Was this useful?

Enter your parameters

Choose the type of attribute analysis you need to run.

Zero-acceptance plan: Find the sample size n such that, if you observe zero defects, you can be C% confident the true defect rate is below p. This is the most conservative and widely used approach in manufacturing inspection.
Express as a decimal — e.g. 0.01 for 1% Enter a proportion between 0 and 1.
Proportion estimate: Find n to estimate the true defect rate within a given margin of error at a chosen confidence level. Use when you want to measure how bad a defect rate is, not just confirm it is below a threshold.
Use 0.5 if completely unknown (conservative) Enter a proportion between 0 and 1.
Acceptable error around the defect rate — e.g. 0.02 means ±2 percentage points Enter a positive margin of error less than 1.
Observed defects analysis: Given a completed inspection (n items checked, d defects found), calculate the point estimate, confidence interval for the true defect rate, sigma level, and DPMO.
Total items inspected Enter a positive integer sample size.
Number of non-conforming items. Enter 0 if none found. Enter a non-negative number of defects (must be ≤ n).
Number of ways a unit can be defective. Enter 1 for simple pass/fail. Enter a positive number of opportunities.
✔️

Ready to calculate

Choose your analysis type, enter the parameters, and press Calculate to see the sample size, confidence intervals, and actionable guidance.

What this means

Required n
Your target
Practical Guidance for Attribute Sampling
How to interpret and act on your attribute sample results
Simulation Lab

Sample Size Simulation

Launching a new component with a 1% defect rate assumption. Enter the lab and find how many items the C=0 plan requires you to inspect.

Complete guide

Attribute Sample Size Calculator 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.

Worked example

Worked example: zero-acceptance audit

A buyer wants 95% confidence the supplier’s defect rate is below 1%. Zero-acceptance sample size: n = ln(0.05) ÷ ln(0.99) ≈ 299 units. Inspect 299 with zero defects allowed; any defect rejects the lot.

If the buyer relaxes the AQL to 2%, sample size drops to 149. Doubling the AQL roughly halves the sample. The calculator makes the trade-off between acceptable quality level and inspection cost explicit before the audit is commissioned.

Why it matters

Operational impact

Right-sized attribute sampling protects you against accepting bad batches and against over-inspecting good ones. It saves money on labour and reduces the defect-rate noise in supplier scorecards.

Decision making

When to use it

Use this for incoming-goods inspection, audit sample selection, supplier qualification, process audits, and any pass/fail acceptance decision.

Lean Six Sigma

Link to Six Sigma

Attribute sample size pairs with DPMO and Sigma Level to give a rigorous defect-rate measurement framework. Most ISO and IATF standards specify attribute-sampling requirements.

Industry examples

Where attribute sample size is useful

Incoming goodsSize supplier acceptance samples to control accept-bad-lot risk at a defined level.
Internal auditSize audit samples to give defensible coverage of process or compliance checks.
Pharmaceutical QAApply zero-acceptance sampling to release-critical attributes.
Software testingSize pass/fail acceptance tests for release decisions.
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.

Resources

Templates, videos and learning

Combine attribute sampling with control charts (p-chart, np-chart) and DPMO for a complete defect-rate measurement framework.

Frequently asked questions

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.

Want to understand attribute sampling in the context of a full measurement plan? The Green Belt covers this in full.

View Green Belt →