Sample Size Calculator
Calculate the required sample size for surveys, experiments, and clinical studies. Accounts for confidence level, margin of error, population size.
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.
What is the design effect and when must the sample size be multiplied by it?
The formula here assumes simple random sampling, where every unit is drawn independently. Cluster designs violate that: sampling whole villages, clinics, litters or quadrats means units within a cluster resemble each other, so each observation carries less independent information. The design effect quantifies the loss, and the required sample is the simple random figure multiplied by it. Values between about 1.5 and 3 are common in field and household surveys. Stratified sampling can push it slightly below one, but treating a cluster design as simple random always overstates precision.
What is the difference between sizing a study for estimation and sizing it for statistical power?
Sample Size Calculator sizes for estimation: it asks how many observations are needed to pin a single proportion within a stated margin. A comparative study asks a different question, whether a difference of a given size can be detected, and its sample size depends on the effect size, the significance level alpha, and the power, or one minus beta, which is conventionally set at eighty or ninety percent. Power calculations grow rapidly as the effect shrinks, so a trial powered for a small difference can need many times the sample an estimation calculation suggests.
Why does each subgroup need its own sample size calculation?
The margin of error applies to the estimate made from the whole sample, and precision scales with the inverse square root of the number of observations actually contributing. A survey of 385 people that reports a five point margin overall gives roughly a seven point margin for a subgroup holding half the sample, and about ten points for one holding a quarter, because those estimates rest on a fraction of the data. If age bands, treatment arms or sites are to be reported separately, size each one to its own target margin and sum, rather than slicing a total afterwards.
How is the sample size found when estimating a mean instead of a proportion?
The structure is the same but the variance term changes. For a proportion the variance is p times one minus p, bounded at 0.25; for a mean it is the population variance, so the requirement becomes n equal to z times the standard deviation divided by the margin, all squared. The margin is now in the units of the measurement rather than percentage points. Because the standard deviation is unknown before the study, it is taken from a pilot, from published work on the same measure, or approximated from an expected range.
Why does inflating for non-response fail to fix non-response bias?
Dividing the target by the expected response rate restores the number of completed observations, so the confidence interval regains its intended width. It does nothing about who is missing. If the people who decline differ systematically from those who reply, on health, income, engagement or severity, then the estimate is displaced regardless of how many responses are collected, and a larger sample simply reports a biased value more precisely. Bias is addressed by improving response, by weighting to known population totals, or by comparing respondents with non-respondents on available data.
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.
๐งฎT-Test Calculator (One & Two Sample)
Calculate t test with inputs, formulas, and instant results.
๐งฎRat Cage Size Calculator (Space per Rat)
Calculate rat cage with inputs, formulas, and instant results.