Sample Size Calculator
Free Sample size Calculator for biostatistics. Enter variables to compute results with formulas and detailed steps. Enter your values for instant results.
Reviewed for accuracy by Daniel Agrici, Founder & Lead Developer
Sample Size Calculator
Calculator
Adjust values & calculateEnter your values below. Every result is computed in your browser โ no data is sent to any server.
Formula: n = (z^2 * p * (1-p)) / e^2, adjusted: n_adj = n / (1 + (n-1)/N)
Worked example โ Sample size: 323 patients (462 invitations needed at 70% response rate)
Formula
n = (z^2 * p * (1-p)) / e^2, adjusted: n_adj = n / (1 + (n-1)/N)
Where n is the unadjusted sample size, z is the z-score for the desired confidence level, p is the estimated population proportion (use 0.5 for maximum), e is the margin of error (as decimal), and N is the population size. The second formula applies finite population correction, reducing n when sampling a significant fraction of the population.
Worked Examples
Example 1: Survey of Hospital Patients
Problem:A hospital with 2,000 patients wants to survey satisfaction with 95% confidence and 5% margin of error. Assume 50% response proportion and 70% response rate.
Solution:z = 1.96 for 95% confidence n0 = (1.96^2 * 0.5 * 0.5) / 0.05^2 = 384.16 Finite correction: n = 384.16 / (1 + (384.16-1)/2000) = 384.16 / 1.1916 = 322.5 Round up: n = 323 Adjust for 70% response: 323 / 0.70 = 462
Result:Sample size: 323 patients (462 invitations needed at 70% response rate)
Example 2: Ecological Bird Population Study
Problem:Estimate the proportion of a bird species with a specific trait in a population of 500 birds. Need 90% confidence with 8% margin of error.
Solution:z = 1.645 for 90% confidence n0 = (1.645^2 * 0.5 * 0.5) / 0.08^2 = 105.7 Finite correction: n = 105.7 / (1 + (105.7-1)/500) = 105.7 / 1.2094 = 87.4 Round up: n = 88
Result:Sample size: 88 birds (17.6% of population) with finite population correction
Frequently Asked Questions
How do I determine the right sample size for my study?
Sample size depends on four key factors: (1) Confidence level - typically 95% for biological research, meaning you want to be 95% confident your results reflect the true population. (2) Margin of error - the acceptable range of uncertainty, usually 3-5% for surveys. (3) Population proportion - if unknown, use 50% as it gives the maximum (most conservative) sample size. (4) Population size - for small populations, a finite population correction reduces the required sample. For clinical trials, you also need to consider effect size, power, and expected dropout rate. Start with the statistical requirements and then add a buffer of 10-20% for non-response or data quality issues.
What is margin of error and how does it affect sample size?
Margin of error (also called confidence interval width) defines how close your sample estimate will be to the true population value. A margin of error of plus or minus 3% means if your sample shows 60%, the true value is likely between 57% and 63%. Reducing margin of error dramatically increases required sample size: going from 5% to 3% nearly triples the sample size, and going from 5% to 1% increases it 25-fold. In biological research, acceptable margins depend on the precision needed. Drug efficacy studies may need plus or minus 2%, while ecological surveys may accept plus or minus 10%.
When does the finite population correction matter?
The finite population correction (FPC) reduces the required sample size when sampling a significant fraction of the total population. It becomes important when your sample exceeds about 5% of the population. For example, with a population of 500 and standard formula giving n=384, the FPC-adjusted n is only 217. For populations over 10,000, the correction is negligible and sample size is essentially independent of population size. This is why national polls of 1,000 people work for populations of millions. In biology, FPC is relevant for small defined populations like endangered species, specific patient cohorts, or students in a school.
Why does using p=50% give the most conservative sample size?
The formula includes p*(1-p), which is maximized when p=0.50 (giving 0.25). If you know the true proportion is near 10% or 90%, p*(1-p)=0.09, requiring much fewer samples. Using p=50% guarantees your sample is large enough regardless of the actual proportion. However, if you have strong prior evidence about the proportion (from pilot studies or previous research), using a more realistic estimate can significantly reduce your required sample size and save resources. For biostatistics studies where the outcome prevalence is known to be rare (e.g., 5%), using p=0.05 can reduce sample requirements by 75%.
How should I account for non-response or dropout in my sample size?
Always inflate your calculated sample size to account for anticipated non-response or dropout. The adjusted size is n_adjusted = n / response_rate. Common response rates: mailed surveys 30-50%, online surveys 10-30%, clinical trials 70-90%, in-person interviews 60-80%. For a 12-month clinical trial expecting 20% dropout, multiply your sample by 1.25 (divide by 0.80). For multi-year longitudinal studies, compound the dropout rate: if 10% drop out each year over 3 years, retention is 0.9^3 = 72.9%. Always report both your target and achieved sample sizes in publications.
References
Background & Theory
History
Reviewed for accuracy by Daniel Agrici, Founder & Lead Developer ยท Editorial policy
Related Calculators
๐งฎPower Sample Size Calculator
Calculate power sample size with inputs, formulas, and instant results.
๐งฎDog Crate Size Calculator
Calculate dog crate size with inputs, formulas, and instant results.
๐งฎDog Harness Size Calculator
Calculate dog harness size with inputs, formulas, and instant results.
๐งฎDog Size Calculator
Calculate dog size with inputs, formulas, and instant results.
๐งฎRabbit CAGE Size Calculator
Calculate rabbit cage size with inputs, formulas, and instant results.
๐งฎTurtle Tank Size Calculator
Calculate turtle tank size with inputs, formulas, and instant results.
๐งฎRat Cage Size Calculator (Space per Rat)
Calculate rat cage with inputs, formulas, and instant results.
๐งฎAlpaca Gestation Calculator
Calculate alpaca gestation with inputs, formulas, and instant results.