Two-Group Sample Size Calculator
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.
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.
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
- Decide on the smallest meaningful difference you want to detect and divide it by the standard deviation to obtain Cohen's d (d = Δ / σ).
- Enter the power you are targeting: 80% is the standard in the literature, while 90% is preferred for high-stakes clinical decisions.
- Choose the significance level (α); if you plan multiple comparisons, enter the Bonferroni-corrected α.
- 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.
- If the groups will not be equal in size, enter the allocation ratio (k) and the expected attrition allowance.
- 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