Sample Size Calculator for Surveys and Experiments
Determine how many participants you need to detect an effect with a specified confidence level and statistical power. Works offline, no signup required.
When you have no prior estimate, use 50% (the assumption that maximizes required sample size, making your calculation conservative).
§2The formula
- n₀
- Initial sample size (without finite population correction)
- z
- Critical z-value for your chosen confidence level (α)
- p
- Expected proportion (0 to 1); use 0.5 if unknown (most conservative)
- e
- Margin of error as a decimal (e.g., 0.05 for 5%)
- If N is finite:
- n = n₀ / (1 + (n₀ − 1) / N)
§3Worked example
Suppose you are planning a survey to estimate the proportion of college students who have used academic tutoring services. You want 95% confidence, a margin of error of 5%, and you assume the true proportion is 50% (unknown = most conservative assumption).
Since you're surveying students within a university of about 15,000, apply the finite population correction:
§4Confidence level and margin of error: what they really mean
Confidence level (e.g., 95%)
A 95% confidence level does not mean there is a 95% probability that your true population value falls within your calculated interval. Instead, it means: if you repeated your study many times using the same sampling procedure, approximately 95% of the confidence intervals you construct would contain the true population parameter.
Margin of error
Also called the width of your confidence interval. A margin of error of ±5% means your estimate could be off by up to 5 percentage points in either direction. Smaller margins of error require larger sample sizes. The relationship is inverse: to cut your margin in half, you need four times as many participants (n ∝ 1/e²).
§5Why 80% power is a convention, not a law
A statistical power of 0.80 (80%) means you have an 80% chance of detecting a true effect of the size you specified. The other 20% is the risk of a Type II error — failing to reject H₀ when it is actually false.
Why 80%? Statistician Jacob Cohen proposed this threshold in 1969 as a rule of thumb when no better benchmark exists. It struck a balance: 80% power usually requires a smaller sample than 90% power, while still reducing Type II error risk substantially. But it is not a hard rule. You might choose:
- 70% power if the cost of recruiting an extra participant is very high relative to the cost of a false negative.
- 90% power or higher if a missed effect would be costly (e.g., a clinical trial where your new treatment might be truly effective but you fail to detect it).
- Custom power based on your field's conventions or your study's risk tolerance.
§6Assumptions and when these calculations break down
Simple random sampling
These formulas assume every member of your population has an equal, independent chance of being selected. If you use stratified sampling (dividing the population into groups and sampling within each stratum), cluster sampling (sampling whole groups at a time), or quota sampling, you must apply a design effect multiplier (usually 1.5–3.0, depending on your design) to the calculated n. Ask your statistician for the appropriate value.
Independence
Observations must be independent. If you survey two family members from the same household, their responses are correlated, violating the assumption. This inflates Type I error rates (false positives).
Post-hoc power: a common mistake
Do not calculate power after you have collected your data, using your observed effect size. Post-hoc power is mathematically redundant with your p-value: a non-significant result will always have low post-hoc power by definition. The only valid power calculation is prospective — before data collection — based on a plausible effect size you expect to detect.
Normality and distributional assumptions
The formulas above assume normality for means and proportions. For proportions far from 0.5 or small samples, exact methods (e.g., Fisher's exact test for 2×2 tables) may be more reliable. For non-normal outcomes (e.g., reaction times, income), consult a statistician.
§7FAQ
How many participants do I need for my dissertation?
That depends on your research question, study design, and the effect size you expect to detect. If you are comparing two groups, use the "Compare Means" or "Compare Proportions" calculator. If you are estimating a population proportion (a survey), use "Survey / Proportion". Consult your advisor and the literature in your field for plausible effect sizes.
What is an effect size, and how do I choose one?
An effect size quantifies the magnitude of the phenomenon you are studying (e.g., Cohen's d for means, the difference between proportions). Larger effect sizes require smaller samples. Guidelines: Cohen's d of 0.2 (small), 0.5 (medium), and 0.8 (large) are conventions for behavioral science, but they are not universal. The best approach is to base your effect size on prior research, a literature review, or a pilot study. If you must guess, assume a "medium" effect and be prepared to justify that choice in your methods section.
Should I use 90%, 95%, or 99% confidence?
95% is standard in most fields. Use 90% if you want a smaller sample and can tolerate slightly more uncertainty. Use 99% only if regulatory or safety requirements demand it, or if your field conventionally uses it. Increasing confidence level from 95% to 99% requires roughly 1.7 times more participants.
What is the margin of error, really?
The margin of error is the half-width of your confidence interval. If you estimate a proportion at 60% with a 5% margin of error, you are saying the true proportion is likely between 55% and 65%. The smaller your margin, the more certain your estimate—but you need more participants.
My population is small. Do I need a finite population correction?
Yes, if your sample will be more than 5% of the population. The finite population correction (1 + (n₀ − 1) / N) slightly reduces your required sample size. If N is very large (e.g., > 100,000 relative to your sample), the correction has negligible effect.
I have already collected data. Can I calculate post-hoc power?
Post-hoc power is not meaningful. If your p-value is not significant, post-hoc power will be low by mathematical necessity. If you want to assess whether your study was adequately powered to detect your observed effect, that is a useful retrospective check, but use the term "observed power" and interpret it cautiously. The correct time to plan power is before data collection.
§8Sources
- OpenStax Introductory Statistics, 2e — Open-access textbook covering sampling distributions, confidence intervals, and hypothesis testing.
- Cochran, W. G. (1977). Sampling Techniques (3rd ed.). Wiley. — Classical reference for survey sample size formulas and finite population corrections.
- UCLA OARC: Sample Size — University of California tutorial on sample size calculation for various designs.
- Cohen, J. (1988). Statistical Power Analysis for the Behavioral Sciences (2nd ed.). Lawrence Erlbaum. — Foundational work defining power, effect size conventions, and the 0.80 threshold.
- Penn State Statistical Consulting Center — Practical guidance on study design and sample size planning.