Two-Group Sample Size Calculator

StatisticsLast updated: August 22, 2026

Every study that compares treatment with control, drug with placebo, or method A with method B has to answer one question before data collection begins: how many participants per group are needed to catch a difference that really exists? That question is answered by a power analysis rather than a plain sample size formula, because what matters is not precision alone but the probability of detecting the difference.

This calculator returns the required sample size per group for designs that compare two independent means (the independent samples t-test). The inputs are the effect size you want to detect (Cohen's d), the power you are targeting (1 − β), the significance level (α), whether the test is one- or two-tailed, and the allocation ratio between the groups. The output gives n per group, the total N, the power actually achieved after rounding, a target adjusted for attrition, a power–sample size table, and a power curve.

d = (μ₁ − μ₂) / σ. Rough benchmarks: 0.20 small, 0.50 medium, 0.80 large.
%
The standard benchmark in the literature is 80%; 90% is preferred for critical clinical decisions.
Sets the false positive risk. In the social sciences 5% is the common choice.
A one-tailed test yields a smaller sample, but should be chosen only if the direction of the difference can be justified in advance.
Leave it at 1 for groups of equal size. Enter 2 if the control group will be twice as large.
%
A reserve added for dropout and missing data.

Required Sample Size per Group in Common Scenarios

The values below are computed from n = 2(z₍α/₂₎ + z₍β₎)² / d², assuming two equally sized groups, a two-tailed test, and the normal approximation. The figure in parentheses is the G*Power result, which uses the noncentral t distribution.

α = 0.05 · power 80% · d = 0.20 (small effect)
393 per group
786 participants in total. Detecting small effects requires a very large sample (G*Power: 394).
α = 0.05 · power 80% · d = 0.50 (medium effect)
63 per group
126 participants in total. The most common reference scenario in the social sciences (G*Power: 64).
α = 0.05 · power 80% · d = 0.80 (large effect)
25 per group
50 participants in total. Doubling the effect size cuts the required sample to a quarter (G*Power: 26).
α = 0.05 · power 90% · d = 0.50
85 per group
Raising power from 80% to 90% grows the sample for a medium effect from 63 to 85, roughly a one-third increase.
α = 0.01 · power 80% · d = 0.50
94 per group
Lowering α from 0.05 to 0.01 increases the required sample by about 50%.
One-tailed α = 0.05 · power 80% · d = 0.50
50 per group
A one-tailed test shrinks the sample by roughly 21%, but the direction must be justified in advance.

Computed with the normal approximation within the Cohen (1988) power analysis frameworkKaynak: Cohen, J. (1988) — Statistical Power Analysis for the Behavioral Sciences (2nd edition)

Sample Size for Two Independent Means

Equal groups:      n = 2 · (z₍α/₂₎ + z₍β₎)² / d²      (per group)
Unequal groups:    n₁ = (1 + 1/k) · (z₍α/₂₎ + z₍β₎)² / d² ,  n₂ = k · n₁
Effect size:       d = (μ₁ − μ₂) / σ      (Cohen's d)
From a raw gap:    d = Δ / σ ,  Δ = smallest meaningful difference to detect
z₍α/₂₎: α = 0.05 → 1.960 · α = 0.01 → 2.576   (one-tailed z₍α₎: 1.645 · 2.326)
z₍β₎: power 80% → 0.842 · 90% → 1.282 · 95% → 1.645
Check:  δ = d / √(1/n₁ + 1/n₂) ,  Power = Φ(δ − z₍α/₂₎)

The formula uses the normal (z) approximation for the independent samples t-test; it typically comes out one or two observations below the G*Power results, which are based on the noncentral t distribution. Equal variances and independent observations are assumed.

How to Calculate

  1. Decide on the smallest meaningful difference you want to detect and divide it by the standard deviation to obtain Cohen's d (d = Δ / σ).
  2. Enter the power you are targeting: 80% is the standard in the literature, while 90% is preferred for high-stakes clinical decisions.
  3. Choose the significance level (α); if you plan multiple comparisons, enter the Bonferroni-corrected α.
  4. Set the test direction — two-tailed is the standard, and one-tailed should be chosen only if the direction of the difference can be justified theoretically.
  5. If the groups will not be equal in size, enter the allocation ratio (k) and the expected attrition allowance.
  6. Read n per group, the total N, and the power achieved after rounding together; pick the scenario that fits your budget from the power–sample size table.

Worked Examples

Medium effect, 80% power (the standard scenario)

To detect a medium-sized difference (d = 0.50) with a two-tailed test at α = 0.05 and 80% power, n = 2 · (1.9600 + 0.8416)² / 0.25 = 62.79, so 63 participants per group and 126 in total are required. With that sample the power actually achieved is 80.13%, and with a 10% attrition allowance you should plan for 70 + 70 = 140 participants.

Required sample size per group (n): 63 · Total sample size (N = n₁ + n₂): 126 · Effect size (d): 0.50

Small effect, 90% power (a large-scale study)

Detecting a small effect (d = 0.20) with 90% power requires 526 participants per group and 1,052 in total; with a 10% attrition allowance the target rises to 579 + 579 = 1,158 people. Because the required sample size is inversely proportional to the square of the effect size, chasing small effects is the main driver of cost.

Required sample size per group (n): 526 · Total sample size (N = n₁ + n₂): 1,052 · Effect size (d): 0.20

Unequal groups: 1 treatment, 2 controls

In a design where the control group is twice the size of the treatment group (k = 2), n₁ = 1.5 · 7.8489 / 0.25 = 47.09 → 48 treatment and 96 control participants, 144 in total, are required. Equal allocation would need only 126 in total, so the unbalanced design pushes the total to 144: imbalance always costs efficiency.

Required sample size for group 1 (n₁): 48 · Required sample size for group 2 (n₂): 96 · Total sample size (N = n₁ + n₂): 144

Frequently Asked Questions

How should I choose the effect size d?
The soundest approach is to decide on the smallest difference (Δ) you consider clinically or practically meaningful and divide it by the expected standard deviation: d = Δ / σ. If a 5-point difference counts as meaningful and σ = 10, then d = 0.50. Effect estimates taken from the literature are usually inflated by publication bias, so choosing a cautious, that is smaller, d is the safer option.
Why is 80% power treated as the standard?
Cohen (1988) suggested β = 4α on the assumption that a Type I error is about four times as serious as a Type II error, which gives β = 0.20 (80% power) for α = 0.05. That is a convention, not a law of nature: for decisions that are hard to reverse, 90% or 95% power is preferred. Power of 80% means you will miss a real effect one time in five.
Why does the result differ from G*Power by one or two people?
This calculator uses the normal (z) approximation, whereas G*Power uses the noncentral t distribution, which is the true distribution of the t-test. For small samples the gap is one or two observations: in the scenario d = 0.50, α = 0.05, 80% power, this calculator gives 63 and G*Power gives 64. For ethics committee applications, rounding the result up by one or two observations is recommended to stay on the safe side.
How much smaller is the sample with a one-tailed test?
In the scenario α = 0.05, 80% power, d = 0.50, a two-tailed test asks for 63 people per group while a one-tailed test needs only 50, a saving of roughly 21%. But choosing a one-tailed test means accepting that you can draw no conclusion at all if the difference comes out in the opposite direction. The direction must therefore be fixed in advance on theoretical grounds, before seeing the data.
Do the groups have to be equal in size?
No, but equal allocation gives the highest power for a given total sample. A k = 2 design (one treatment against two controls) raises the total from 126 to 144 to achieve the same power. Unequal allocation is preferable only when access to one group is expensive or limited (a rare disease, a scarce drug).
Can I use this formula for paired measurements?
No. In pre-post or matched designs the correlation between measurements shrinks the standard error of the difference and the required sample drops considerably. Such designs use d_z, based on the standard deviation of the differences, in place of d, and the formula reduces to n = (z₍α/₂₎ + z₍β₎)² / d_z², which gives the total number of pairs rather than a per-group figure.
Should I correct α for multiple comparisons?
Yes. If you plan three pairwise comparisons, for example, the Bonferroni correction calls for α = 0.05 / 3 ≈ 0.017, which enlarges the required sample noticeably. Selecting 0.01 from the α options in this calculator gives a rough upper bound. With more than three groups, an ANOVA-based power analysis (using the effect size f) is more appropriate.