Sample Size Calculator
How many responses or samples you need for a given confidence level and margin of error
Loading the tool…
Calculates how many responses or samples a survey or experiment needs for a given confidence level, margin of error or power. Use it to decide how many people to survey, or how many subjects each group needs.
How to use
- Choose a tab: "Proportion (survey)", "Mean", "Compare two means" or "Compare two proportions".
- For a survey, enter the "Confidence level", "Margin of error (±)" and "Expected proportion", and the "Population size (optional)" if the group is a known number.
- To compare two groups, set the effect size (or mean difference and standard deviation), "Significance level α", "Power" and "Test direction".
- To get the margin of error for a given sample size, switch "Solve for" to "Margin of error".
How it works
- For a proportion, n₀ = z² × p(1 − p) ÷ e². With a population size N, n = n₀ ÷ (1 + (n₀ − 1) ÷ N). Results are rounded up.
- For two means, the power of the two-sample t-test is computed with the non-central t distribution, and the smallest n per group that reaches the target is shown.
- Simple random sampling is assumed; response rate and dropout are not included. See "Formula and assumptions" for details.
Questions and answers
- What sample size do I need for a survey?
- At 95% confidence, ±5% margin of error and 50% expected proportion: 1.96² × 0.25 ÷ 0.05² ≈ 384.2, so 385. For ±3% you need 1,068.
- Does a small population need a smaller sample?
- Yes. With the same settings and a population of 1,000, the finite population correction gives 278. For a very large population, size hardly matters.
- What expected proportion should I use if I do not know it?
- Use 50%. p(1 − p) is largest there, so it gives the largest, safest sample size.
- How many subjects per group do I need to compare two groups?
- With effect size d = 0.5, α = 0.05, 80% power and a two-sided test, 64 per group. Smaller effects need more.