Attribute Sampling Calculator

Optimize your quality control with our Attribute Sample Size Calculator. Instantly generate Zero Defect (c=0) plans, assess risk, and visualize performance using our dynamic Operating Characteristic curve.

Updated December 2025

Calculator

LIVE
%
Defect rate to reject.

Inspection Plan

Zero Defect (c=0)

Reject lot if 1+ defects found.

Sample Size
--
Operating Characteristic (OC)
Interpreting: If lot has 1% defects, plan accepts it 5.0% of the time.
Assurance 95% Confidence defect rate < 1%
Risk (Beta) 5% Chance of accepting bad lot.
On this page

    Attribute Sampling Guide

    A comprehensive guide to Zero Acceptance Number (c=0) plans. Understand risk, confidence, and why we sample.

    The Lottery of Sampling

    Sampling is all about probability. Even if defects exist in the lot, there is a chance your sample might "miss" them. This is called Consumer's Risk.

    Load a scenario to begin...

    What just happened?

    If you see red dots in the grid but your sample (circled dots) only picked gray ones, you just accepted a bad lot! This demonstrates why we need statistically calculated sample sizes rather than guessing.

    Choosing Confidence Levels

    The "Confidence Level" is the mathematical inverse of Risk. If you want 95% Confidence, you are accepting a 5% risk that a bad lot might slip through.

    90% CONF

    Moderate Control

    Used for minor defects or cosmetic issues where a failure isn't critical. You accept a 10% Risk of missing the defect.

    Risk: 0.10
    95% CONF

    Industry Standard

    The default for most manufacturing. It provides a strong balance between sample size efficiency and protection.

    Risk: 0.05
    99% CONF

    Critical Safety

    Used for medical devices, aerospace, or automotive safety parts. Requires much larger sample sizes.

    Risk: 0.01
    90% 95% 99% Confidence Meter Hover list to see levels

    Why not 100% Confidence?

    To get 100% confidence, you must inspect 100% of the parts. Sampling is, by definition, an exercise in calculating and accepting a specific amount of risk.

    AQL vs. RQL: The Battle

    The most common confusion in sampling is between "What we expect" and "What we reject".

    Expectation

    AQL (Acceptable Quality Level)

    "The Good Days"
    This is the quality level you normally expect from the process. If a lot has this many defects, you want to ACCEPT it most of the time.

    Protection

    RQL (Rejectable Quality Level)

    "The Limit"
    Also called LTPD. This is the worst-case scenario. If a lot has this many defects, you want to REJECT it (almost) every time.

    The calculator above uses RQL to calculate the sample size for safety.

    AQL High Acceptance RQL High Rejection 100% 0% Defect Rate %
    Operating Characteristic (OC) Curve showing the two zones.

    The Formula

    For a Zero Acceptance Number (c=0) plan, the math uses the Binomial Distribution approximation. It asks: "How many parts must I check so that the chance of seeing 0 defects is less than my risk threshold?"

    The Equation

    Sample Size (n)

    n=
    ln(Risk) ln(1 - p)

    Where ln is the natural logarithm, Risk is (1 - Confidence), and p is the RQL defect rate as a decimal.

    Example

    Calculation

    Target: 95% Confidence, 5% RQL.

    Risk: 0.05

    p: 0.05

    n = ln(0.05) / ln(0.95)
    n = -2.996 / -0.051
    n = 58.7 => 59
    n

    Sample Size

    The number of parts to check.

    β

    Beta (Risk)

    The Consumer's Risk (e.g., 0.05 or 5%).

    p

    RQL

    The defect rate you want to detect (decimal).

    Troubleshooting

    Common issues when setting up inspection plans.

    Sample Size is Too High

    1

    Check your RQL

    If you enter an RQL of 0.01% (extremely rare defects), the math will demand thousands of samples to prove it. Is that realistic?

    2

    Adjust Confidence

    Do you really need 99% confidence for a cosmetic label? Dropping to 90% or 95% drastically reduces sample size.

    Lot Failed. Now what?

    !

    Do NOT Resample

    The most dangerous mistake is "sampling until you pass." If you found a defect, the statistical validity is gone. You must quarantine the lot.

    2

    100% Inspection

    The only way to save the lot is to inspect every single part (100% sort) and remove the bad ones.

    Expert Knowledge

    Common Sampling Questions

    What does "c=0" actually mean?

    c=0 is shorthand for "Acceptance Number (c) equals Zero". It is a zero-tolerance plan. If you find even 1 defect in your sample, the math assumes the entire lot is suspect, and you must reject it.

    REJECT

    Can I use this for variable data (measurements)?

    No. This calculator is for Attribute data (Pass/Fail). Variable data (e.g., "5.2mm", "10.1kg") gives you more information, so you can use smaller sample sizes with a Variables Plan (ANSI Z1.9).

    Variable (Measure) Attribute (Pass/Fail)

    Why doesn't Lot Size (N) matter much?

    Think of it as Tasting Soup. If the soup is stirred well (randomized), a single spoonful tells you if it's too salty. It doesn't matter if the pot is 1 gallon or 100 gallons; the spoon (sample) size remains the same.

    Small Lot Huge Lot Same Sample!

    If I find 1 defect, can I just re-sample?

    Absolutely Not. This is called "Gambling until you win." If you found a defect, the statistical validity of the "Pass" is broken. Re-sampling doubles your risk of accepting a bad lot.

    Try again?

    What is Consumer's vs. Producer's Risk?

    Producer's Risk (α): The chance we reject a Good lot. (The factory is sad, waste of money).
    Consumer's Risk (β): The chance we accept a Bad lot. (The customer is sad, safety risk).
    c=0 plans prioritize reducing the Consumer's Risk.

    🏭 Producer 😡 Consumer