# Microbial Sampling Plan Acceptance Probability Calculator

> Source: https://netray.co/tools/microbial-sampling-plan-acceptance-probability-calculator
> Publisher: Netray (netray.co), AI and integration engineering for ERP and manufacturing systems.
> Section: Free Tools

## Short answer

See how likely a zero-tolerance sampling plan is to detect a contaminated lot, and how many samples you need for a target confidence.

## Category

quality

## Industry

Food and Beverage

## Audience

- Food safety manager
- Quality manager
- Lab manager

## Tool

**Kind:** calculator

**Inputs:**

#### Number of samples tested

**Key:** n

**Type:** number

**Default:** 60

**Min:** 1

**Step:** 1

**Unit:** samples

**Help:** Count of independent sample units, c=0.

#### True contamination prevalence in lot

**Key:** prev

**Type:** number

**Default:** 2

**Min:** 0.01

**Max:** 100

**Step:** 0.1

**Unit:** %

**Help:** Percent of units that are contaminated.

#### Required detection confidence

**Key:** conf

**Type:** select

**Default:** 0.95

**Options:**

##### 90%

**Value:** 0.9

##### 95%

**Value:** 0.95

##### 99%

**Value:** 0.99

**Outputs:**

#### Chance a contaminated lot passes

**Key:** p_accept

**Expr:** pow(1 - prev / 100, n) * 100

**Format:** percent

**Primary:** true

**Description:** Probability that all n samples test negative.

#### Chance the plan detects the lot

**Key:** p_detect

**Expr:** 100 - pow(1 - prev / 100, n) * 100

**Format:** percent

**Primary:** true

#### Samples needed for required confidence

**Key:** n_needed

**Expr:** ceil(ln(1 - conf) / ln(1 - prev / 100))

**Format:** integer

**Description:** Smallest n giving at least the chosen detection confidence at this prevalence.

**Chart:**

#### Detection probability vs prevalence

**Type:** line

**X:** prev

**From:** 0.5

**To:** 20

**Steps:** 40

**Series:**

- p_detect

**Disclaimer:** Assumes random independent sampling from a homogeneous lot. Contamination is often clustered, which lowers real detection. Pathogen sampling gives limited assurance and does not replace preventive controls.

## Content

**Intro:** Negative test results are weaker evidence than most people expect. This calculator shows the probability that a zero-positive-allowed sampling plan catches a lot with a given contamination rate.

**Sections:**

#### How to use it

**Body:** Enter how many sample units you test and the contamination prevalence you want to be able to detect. The tool returns the chance that a lot at that prevalence still passes, the chance it is detected, and the number of samples needed for your confidence target. Try prevalences from 0.5 to 5 percent to see why finished product testing alone cannot prove a lot is clean.

**Bullets:**

- c = 0 means any positive fails the lot
- Composite samples count as one test unit
- Combine with environmental monitoring

#### The math

**Body:** If a fraction p of units are contaminated and you test n independent units, the chance all are negative is (1 minus p) to the power n. Detection probability is one minus that. To reach confidence C, n equals ln(1 minus C) divided by ln(1 minus p). For 95 percent confidence at 1 percent prevalence that is about 299 samples, the familiar rule of three style result.

#### Example and cautions

**Body:** Sixty samples against a 2 percent prevalence lot give a 70 percent chance of detection and 30 percent chance the lot passes. At 0.5 percent prevalence, 60 samples detect less than 30 percent of lots. Cautions: real contamination clusters, sample units are small compared to the lot, and test sensitivity is below 100 percent. Treat sampling as verification of your controls, not a control itself.

**Cta:** Lot test results, holds and releases usually span the LIMS and ERP. Netray can build a read-only view that links them for traceability reviews.

**Faq:**

#### Why do negative results not prove a lot is safe?

**Answer:** Because low prevalence contamination is rarely hit by a practical number of samples. At 1 percent prevalence, 60 samples only detect it about 45 percent of the time.

#### What does c = 0 mean?

**Answer:** In a two-class plan, c is the maximum allowed number of positive samples. With c = 0 any positive result rejects the lot, which is typical for pathogens.

#### How many samples do regulators require?

**Answer:** It depends on the pathogen, product and rule. Plans from ICMSF, FSIS or customer specifications vary, so follow the applicable requirement rather than this calculator.

#### Does compositing samples change the math?

**Answer:** Compositing pools units into one analytical test. The math then depends on dilution and method sensitivity, so treat the number of composites as n only with caution.

## Search terms

microbial sampling plan calculator, salmonella sampling plan probability, number of samples to detect contamination, two class sampling plan, detection probability sampling food, ICMSF sampling plan calculator, lot acceptance probability pathogen, how many samples to test food lot

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