Sample Size & Margin of Error Calculator
Calculate the exact number of responses or audit rows needed to represent your entire population with statistical confidence.
Simple Random Sampling (SRS) selects an unbiased subset of items where every member of the population has an identical chance of selection. Using Cochran's formula with Finite Population Correction, you can audit just 370 records from a batch of 10,000 packages and achieve 95% statistical confidence with a 5% margin of error!
What Is Simple Random Sampling (SRS)?
Imagine your company handles 10,000 invoices per week, and quality assurance needs to check for billing errors. Manually reviewing every invoice would halt operations. Instead, QA can select a random sample.
Because every invoice has an equal probability of being selected, the error rate observed in the sample provides a mathematically sound estimate of the entire 10,000-invoice dataset.
Sampling With Replacement vs. Without Replacement
- Without Replacement (Standard for Audits & Surveys): Once a record is drawn into your sample, it is permanently removed from the remaining pool. Every record in your sample is unique. Our Random Sample Generator uses sampling without replacement by default.
- With Replacement: The selected record is recorded and immediately returned to the pool, meaning it could theoretically be chosen again. Used primarily in probability modeling, bootstrap simulations, and Monte Carlo experiments.
How to Calculate Your Required Sample Size
The standard statistical formula for determining sample size is Cochran's Formula:
n_0 = (Z^2 × p × (1 - p)) / e^2
Z = Z-score corresponding to confidence level (1.96 for 95%, 2.576 for 99%).
p = Estimated population proportion (use 0.5 for maximum variability / conservative estimate).
e = Acceptable margin of error (e.g. 0.05 for ±5%).
When sampling from a known finite population N, we apply the Finite Population Correction (FPC):
n = n_0 / [ 1 + ((n_0 - 1) / N) ]
Worked Example: If your population is N = 1,000, with a 95% confidence level (Z = 1.96) and a 5% margin of error (e = 0.05):
n_0 = (1.96^2 × 0.5 × 0.5) / 0.05^2 = (3.8416 × 0.25) / 0.0025 = 384.16n = 384.16 / [ 1 + (383.16 / 1000) ] = 384.16 / 1.38316 ≈ 278 samples
Sample Size Reference Table
| Total Population (N) | Strict Audit Sample (95% Conf, ±5% Margin) | Informal QA Check | Recommended Tool |
|---|---|---|---|
| 100 records | 80 records | 15 to 25 records | Sample Generator |
| 500 records | 217 records | 35 to 50 records | Sample Generator |
| 1,000 records | 278 records | 50 to 75 records | Sample Generator |
| 5,000 records | 357 records | 100 records | Sample Generator |
| 10,000+ records | 370 to 384 records | 100 to 200 records | Sample Generator |
Why Humans Cannot Manually Pick Random Samples
Never attempt to pick "random" spreadsheet rows by eye. Human cognitive biases skew the selection:
- Convenience Bias: Humans consistently pick rows near the top or bottom of a sheet to avoid scrolling.
- Salience Bias: Rows containing unusually high dollar amounts, recognized client names, or distinct dates catch the eye and are picked at 4x the natural rate.
- The Number 7 Trap: When asked to name a random number between 1 and 10, over 28% of humans pick 7, while less than 2% pick 1.
Your 5-Step Audit Checklist
- Export your complete dataset: Verify that no eligible records were excluded and no header rows are mixed with data rows.
- Calculate target sample size: Use our sample calculator above to determine the required sample size
n. - Sample without replacement: Ensure drawn records cannot duplicate.
- Execute draw in a single pass: Never re-roll or swap individual items because an outcome looks unusual.
- Document the sample parameters: Record date, population count, sample size, and random seed/timestamp for audit compliance.
Random Sample Generator
Put this math into practice right now. Safe, free, and runs 100% locally in your browser.
