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 CORRECTIONReliability and confidence sample size
ZERO-FAILURE (c = 0) SUCCESS RUN · c FAILURES ALLOWED · VALIDATION AND ATTRIBUTE TESTINGFor 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.
| Population | Sample needed | Saving vs 385 |
|---|---|---|
| 100 | 80 | 79% |
| 200 | 132 | 66% |
| 500 | 218 | 43% |
| 1,000 | 278 | 28% |
| 5,000 | 357 | 7% |
| 50,000 | 382 | 0.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 / confidence | c = 0 | c = 1 | c = 2 |
|---|---|---|---|
| 90% / 90% | 22 | 38 | 52 |
| 90% / 95% | 29 | 46 | 61 |
| 95% / 90% | 45 | 77 | 105 |
| 95% / 95% | 59 | 93 | 124 |
| 99% / 90% | 230 | 388 | 531 |
| 99% / 95% | 299 | 473 | 628 |
Where sample sizing goes wrong
- Margin of error read as relative. ±5 points on a result of 8 percent means the true value is somewhere between 3 and 13 — which is not a useful answer. If you need precision around a small proportion, the sample is far larger than 385.
- The square root of n plus one. Widely used, easy to remember, and it has no statistical basis at all. It produces a plan whose protection nobody has ever calculated.
- A representative number taken unrepresentatively. The arithmetic assumes a random sample. Three hundred and eighty-five pieces all taken from the top of the last pallet satisfy the formula and none of its assumptions.
- Non-response ignored. If you need 385 answers and half your recipients reply, you needed to ask 770 — and the half who did not reply may not resemble the half who did.
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.
- One mean against a target: n = ((zα + zβ) σ ÷ δ)².
- Two means compared: twice that, in each group.
- One proportion against a target: n = ((zα√(p0q0) + zβ√(p1q1)) ÷ |p1 − p0|)².
- Two proportions compared: the same form, with the pooled proportion under the null hypothesis.
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.