Home › Calculators › Sample size

Sample size

SCQUALITYGUILD.COM/CALCULATORS/SAMPLE-SIZE.HTML

How many units you need for a proportion or a mean, at your confidence and margin of error, with finite population correction. For validation, the reliability and confidence calculator gives the units to test for a claim like 95% reliability at 95% confidence, with zero or more failures allowed.

ESTIMATION OR TESTS · POWER · MEANS AND PROPORTIONS · FINITE POPULATION CORRECTION · FREE · NOTHING YOU TYPE LEAVES YOUR BROWSER

Q-BotClick for an explanation of this calculator.

Sample size

ESTIMATION OR TESTS · POWER · MEANS AND PROPORTIONS · FINITE POPULATION CORRECTION
—SAMPLE SIZE
—WITH FPC
—z VALUE

Reliability and confidence sample size

ZERO-FAILURE (c = 0) SUCCESS RUN · c FAILURES ALLOWED · VALIDATION AND ATTRIBUTE TESTING
—UNITS TO TEST
—RELIABILITY SHOWN BY YOUR n

For educational use. This page is a study aid. The method behind it has far more depth and detail than one page and one tool can cover, and what you see here is not everything the method offers or everything this site offers. For full understanding and application, use the governing standards and texts, and seek further education, training or qualified advice. Results depend on the data you enter, so check them before relying on them.

The number nearly everybody has heard

For a proportion, at 95 percent confidence and a margin of error of five percentage points, you need 385. That single figure sits behind an enormous amount of survey and audit sampling, and it is worth knowing where it comes from.

It assumes the worst case for the proportion itself. Variability of a proportion is largest at fifty percent, so using p = 0.5 gives the biggest sample any proportion could require. If you genuinely know the rate is near five percent, the required sample drops sharply — but if you are guessing, 0.5 is the honest choice.

When the population size matters, and when it does not

The finite population correction reduces the sample when the population is small enough that you would be taking a real bite out of it. People reach for it constantly. It is usually doing nothing.

COMPUTED — 95% CONFIDENCE, ±5 POINTS, p = 0.5
PopulationSample neededSaving vs 385
1008079%
20013266%
50021843%
1,00027828%
5,0003577%
50,0003820.8%

Past a few thousand, the population size is irrelevant. Sampling a city of fifty thousand and a city of fifty million takes essentially the same number of people, which is the single most counter-intuitive fact in sampling and the one most worth internalizing.

This is not an acceptance sampling plan

A sample size for estimating a proportion and a sample size for accepting or rejecting a lot are different calculations answering different questions. This page sizes an estimate to a margin of error. If what you actually want is "how many do I inspect before I ship this lot", you want an operating characteristic curve and a stated producer's and consumer's risk instead.

Reliability and confidence sample size (success run)

For validation, design verification and attribute testing the question is usually not “what is the rate” but “can we claim at least R reliability with C confidence?” With zero failures allowed (c = 0) the success-run formula gives the answer: n = ln(1 − C) ÷ ln(R), rounded up. Allowing failures uses the binomial distribution and needs more units. The reliability calculator above does both, and shows the reliability a test you already ran demonstrates.

Reliability / confidencec = 0c = 1c = 2
90% / 90%223852
90% / 95%294661
95% / 90%4577105
95% / 95%5993124
99% / 90%230388531
99% / 95%299473628

Where sample sizing goes wrong

Sample size and power for a test

Estimating a value and testing a claim need different sample sizes. A test needs four things: the significance level α (100 minus the confidence), the power 1 − β (the chance of detecting a difference that really is there), the smallest difference worth detecting, and an estimate of the variation.

For a two-sided test zα is taken at α/2. These are the normal-approximation formulas the examinations use; software that uses the t distribution usually asks for one or two more units when n is small. Enter a sample size you already have to see the power it gives: a test that comes back “not significant” on too few units has not shown that there is no difference.

Common questions

How many samples do I need for 95% reliability at 95% confidence?

With zero failures allowed, 59. The success-run formula is n = ln(1 − C) ÷ ln(R): ln(0.05) ÷ ln(0.95) = 58.4, rounded up to 59. If one failure is allowed the same claim needs 93.

What is a c = 0 sample size?

A zero-acceptance (c = 0) plan passes the lot or the validation only if no failures are found. It gives the smallest sample for a given reliability and confidence claim, but one failure fails the test, so many validation plans allow c = 1 and test more units.

Is the reliability sample size the same as a sample size for a proportion?

No. A proportion sample size estimates a rate within a margin of error. A reliability and confidence sample size demonstrates that the rate of good units is at least R with confidence C, using the binomial distribution. Use the calculator above for estimates and tests, and the reliability calculator for validation and attribute demonstration.

What does 90/90 or 95/95 mean in validation?

The first number is the reliability (the proportion of conforming units being claimed) and the second is the confidence in that claim. 90/90 with zero failures needs 22 units; 95/95 needs 59; 99/95 needs 299.

How do I find the sample size to compare two means?

Set ESTIMATING to “Test: two means compared”, then enter the estimated σ, the smallest difference δ worth detecting, the confidence and the power. Each group needs n = 2((zα + zβ)σ ÷ δ)². With σ = 2, δ = 1, 95% confidence two-sided and 80% power, that is 2 × ((1.960 + 0.842) × 2)² = 62.8, so 63 in each group.

Other calculators

Your work is kept in this browser only, until you clear it. Use Save to a file to keep a copy or move it to another computer.