What Is Sample Size?
Sample size depends on what you want to learn. When estimating a value, it depends on the margin of error you accept and your confidence level. When comparing two groups, it also depends on the size of the difference you want to detect and the power of the test, which is the chance of detecting it if it is real.
The calculator covers four common cases: estimating a proportion, estimating a mean, comparing two means per group and comparing two proportions per group. It shows the z values used and the total across both groups for comparisons.
Below you will find the formulas, a variables table, a worked example and answers to common questions such as what power to aim for and how to choose the effect size.
How to Use the Sample Size Calculator
- Choose whether you are estimating one value or comparing two groups.
- Enter the quantities asked for: expected proportions or standard deviation and the margin or difference you need to detect.
- Keep α at 0.05 and power at 80% unless you have a reason to change them.
- Add an expected drop-out percentage so you recruit enough participants.
- Use the chart to see how sensitive the sample size is to your assumptions.
Sample Size Formula
Estimating a proportion
Estimating a mean
Two means, per group
Two proportions, per group
Sample Size Variables Explained
| Symbol | Meaning | Notes |
|---|---|---|
| n | Required sample size | Rounded up |
| z(α) | Critical value for the confidence level | |
| z(β) | Critical value for the power | |
| σ or p | Standard deviation or proportion | From a pilot or prior study |
| E or δ | Margin of error or difference to detect |
Sample Size Worked Example
Using the example values (press “Load example” above to try them):
- p̄ = (0.3 + 0.45) ÷ 2 = 0.375; z(α/2) = 1.96, z(power) = 0.8416.
- n per group = [z(α/2)√(2p̄(1 − p̄)) + z(β)√(p₁q₁ + p₂q₂)]² ÷ (p₁ − p₂)² = 162.33.
- Round up to 163; allowing for 10% drop-out gives 182.
Result: Sample size per group (two proportions) = 163; Total across both groups = 326.
What power means and why 80%?
Power is the probability that your study will detect an effect of the size you specified, if it exists. At 80% power you accept a 20% chance of missing a real effect. Conventions of 80% or 90% balance the cost of recruitment against the cost of a missed finding. Underpowered studies waste resources and produce unreliable results, even when they happen to reach significance.
| Change | Effect on n |
|---|---|
| Halve the effect size to detect | About 4 times larger |
| Halve the margin of error | About 4 times larger |
| Increase power from 80% to 90% | About 30% larger |
| Reduce α from 0.05 to 0.01 | About 50% larger |
| Double the standard deviation | About 4 times larger |
Choosing the effect size
The most important and hardest input is the smallest difference worth detecting. Base it on the minimum difference that would matter in practice, previous studies or a pilot, rather than on a guess at the true effect. If you cannot defend the value, state the assumption openly.
| Cohen’s d | Description | n per group |
|---|---|---|
| 0.2 | Small | 393 |
| 0.5 | Medium | 63 |
| 0.8 | Large | 25 |
| 1.0 | Very large | 16 |
Drop-out and non-response
The calculated n is the number of participants who provide usable data. Divide by (1 − expected drop-out rate) to find how many to enroll. A 10% drop-out turns 100 required participants into 112 to recruit.
Assumptions behind the formulas
- Simple random sampling and independent observations.
- Normal approximation; for very small samples or extreme proportions, exact methods are better.
- Equal group sizes for the two-group formulas; unequal allocation needs more total participants.
- Two-sided test. A one-sided test needs a smaller n but is rarely justified.
- Standard deviations and proportions are estimates; use pilot data or published values.
Where Sample Size Is Used
Research proposals
Justifying how many participants a study needs.
Surveys
Choosing how many responses to collect for a given margin of error.
Group comparisons
Planning a two-group experiment with a target power.
Trade-off checks
Seeing how a tighter margin or higher power changes the sample.
Common Sample Size Mistakes to Avoid
- Do the power calculation before collecting data.
- Be conservative with standard deviations.
- Plan for drop-out and missing data.
- Document your assumptions so reviewers can check them.
Sample Size Terms and Definitions
- Power
- Probability of detecting a true effect of the stated size.
- Effect size
- The difference you want to be able to detect, often standardised.
- Type II error
- Missing a real effect; probability β = 1 − power.
Sample Size FAQs
How do I calculate the sample size for my study?
Decide whether you are estimating or comparing, then supply the margin of error or the difference to detect, the variability, α and the power you want.
What is the minimum sample size for statistical significance?
There is no single minimum. It depends on the effect size, variability and desired power. Larger effects need smaller samples.
What is the difference between sample size for estimation and for comparison?
Estimation uses a target margin of error; comparison uses a target difference and power.
What power should I use?
At least 80%; 90% for important or hard-to-repeat studies.
Why does the sample size go up so fast for small effects?
The required n scales with the inverse square of the effect size. Halving the effect multiplies n by four.
Should I add extra participants for drop-out?
Yes. Divide the calculated sample by one minus the expected drop-out rate.
How does the margin of error change the sample size?
Sample size grows with the inverse square of the margin of error, so halving the margin of error needs about four times the sample. At 95 % confidence and p = 0.5, ±3 % needs about 1,068 responses and ±1 % needs 9,604.
What power should I aim for when comparing two groups?
80 % is a common convention and 90 % is used when missing a real effect is costly. Higher power needs a larger sample, so it is worth deciding on a realistic effect size before you start.