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.
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\nn0 = (1.96^2 * 0.5 * 0.5) / 0.05^2 = 384.16\nFinite correction: n = 384.16 / (1 + (384.16-1)/2000) = 384.16 / 1.1916 = 322.5\nRound up: n = 323\nAdjust 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\nn0 = (1.645^2 * 0.5 * 0.5) / 0.08^2 = 105.7\nFinite correction: n = 105.7 / (1 + (105.7-1)/500) = 105.7 / 1.2094 = 87.4\nRound 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%.
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.
How accurate are the results from Sample Size Calculator?
All calculations use established mathematical formulas and are performed with high-precision arithmetic. Results are accurate to the precision shown. For critical decisions in finance, medicine, or engineering, always verify results with a qualified professional.
How do I interpret the result?
Results are displayed with a label and unit to help you understand the output. Many calculators include a short explanation or classification below the result (for example, a BMI category or risk level). Refer to the worked examples section on this page for real-world context.