Sample Size Calculator
Find out how many responses or participants you need. This sample size calculator covers surveys, from your confidence level, margin of error and expected proportion, and studies comparing two groups, from effect size, significance level and power.
Sample size needed
385
Writing the methods section from a draft or scanned protocol? Turn it into LaTeX.
Convert a fileWhat Is a Sample Size Calculator?
Sample Size for Surveys
For a survey or prevalence study, a sample size calculator finds how many responses you need for a chosen confidence level and margin of error, using Cochran’s formula. It assumes simple random sampling and a normal approximation, which suits most surveys.
Sample Size for Comparing Two Groups
For an experiment or trial with two groups, it finds how many participants each group needs to detect a given effect size with the power you choose. The sample size calculator uses the normal approximation; a t-based method adds one or two participants per group.
Finite Populations
When the population is small, such as one school or one company, entering its size applies the finite population correction and lowers the number needed. The correction matters most when the sample would be more than about 5% of the population.
Why Use Our Sample Size Calculator?
Two Common Designs in One Place
The sample size calculator handles both survey precision and two-group power, so there is no need to switch between websites. Results update as you type.
Transparent Formulas
Every result comes from standard published formulas, quoted in the FAQ, so you can cite the method in your proposal. Nothing is hidden behind a sign-up or a paywall.
Browse all free toolsAlready Have Data?
Once results are in, the confidence interval calculator shows how precise your estimate turned out to be.
Open the confidence interval calculatorHow to Use It in 3 Steps
Step 1: Choose Your Design
Pick survey for estimating a proportion, or two groups for comparing means. You can switch between the two at any time.
Step 2: Enter Your Assumptions
Set the confidence level and margin of error, or the effect size, significance level and power. Sensible defaults are filled in so you can start from a typical case.
Step 3: Plan Recruitment
The sample size calculator shows the number needed; add a margin for dropouts and non-response.
Convert your protocol to LaTeXOfficial references: NIST/SEMATECH e-Handbook of Statistical Methods

Sample Size Calculator FAQ
- How to calculate sample size?
- For a survey, n = z² × p(1 − p) / e², with z for the confidence level, p the expected proportion and e the margin of error, then adjust for population size. For two groups, see the formula below. The sample size calculator does both.
- What is sample size?
- The number of people, items or observations in a sample, usually written n. It sets how precise your estimates are and how likely a study is to detect a real effect. In formulas, N often stands for the population and n for the sample.
- What is a good sample size?
- One that gives the precision or power your question needs. About 385 responses give ±5% at 95% confidence for a large population; comparing two groups for a medium effect needs about 63 to 64 per group at 80% power. The sample size calculator gives the exact figure for your own assumptions.
- How to calculate sample size in research?
- Decide the main outcome, the smallest effect worth detecting, the significance level and the power, then calculate and add extra for expected dropouts. Report every input in your methods. Many funders also expect a power analysis in the proposal.
- What is a sample size in a survey?
- The number of completed responses you need. At 95% confidence and a 5% margin that is 385 for a large population, and fewer for a small one: a population of 1,000 needs 278. Response rates are rarely 100%, so invite more people than this number.
- How does sample size affect confidence interval?
- Larger samples give narrower intervals. The width shrinks with the square root of n, so quadrupling the sample halves the margin of error. That is why going from 100 to 400 responses improves precision far more than going from 1,000 to 1,300.
- Why is sample size important?
- Too small a sample gives imprecise estimates and misses real effects; too large wastes time and money and may expose more participants than needed. Ethics committees and journals expect a justified calculation. A short justification in the protocol saves questions from reviewers later.
- How to calculate sample size formula?
- Cochran’s formula n₀ = z²p(1 − p)/e² for proportions, with the finite population correction n = n₀ / (1 + (n₀ − 1)/N). For two means, n = 2(z₁₋α/₂ + z₁₋β)² / d² per group. Here z is the standard normal quantile, d the effect size and N the population size.
- How to calculate sample size based on power?
- Choose the power (usually 80% or 90%), the significance level and the expected effect size, then use the two-group mode above. Higher power or a smaller effect needs more participants. The sample size calculator shows the per-group and total numbers together.
- A/B testing sample size?
- Treat each variant as a group. Express the expected lift as an effect size, or estimate each conversion rate to a set margin in survey mode, and run the test until every variant reaches that size. Stopping early when the result looks good inflates false positives.
- What if I do not know the population size?
- Leave the population field empty. For large or unknown populations the correction makes almost no difference, so the calculator uses the formula for an infinite population. Even a population of 100,000 needs only a handful fewer responses than an infinite one.
- How many participants do I need to compare two groups?
- Use the two-group mode with Cohen’s d. Conventional values are 0.2 for small, 0.5 for medium and 0.8 for large effects; a medium effect at α = 0.05 and 80% power needs about 63 per group. If you are unsure of the effect, base it on earlier studies rather than on hope.
- What is a design effect and when do I need it?
- Cluster and multistage samples carry less information than simple random ones. Multiply the calculated size by the design effect, often 1.5 to 2, to make up for it. Survey statisticians estimate it from the intraclass correlation and the average cluster size.
- How do I report a sample size calculation?
- State the outcome, the expected effect or proportion and where it came from, the significance level, the power or margin of error, the resulting n and any allowance for dropouts. A single sentence in the methods section is usually enough.
- How do I choose the expected proportion?
- Use a figure from earlier studies or a pilot. If you have none, use 50%, which gives the largest and safest sample size. Proportions far from 50% need smaller samples for the same margin of error.
- Is anything I enter stored?
- No. The sample size calculator runs entirely in your browser, and nothing you type is sent or saved.
Have a whole page of notes, a scan or a PDF? Convert it to LaTeX that compiles.
Convert a file