← All calculators

Sample Size & Power

How many per group for comparing two means or two proportions, with dropout inflation — plus the smallest difference a fixed n can detect. The same math as the Excel workbook, live in your browser.

What this is for: How many subjects per group to detect a chosen difference in means or proportions at your alpha and power, with dropout inflation.

The formula: n per group = 2 × ((z(α/2) + z(power)) × SD ÷ difference)² (two means)

How to use:

  1. For a continuous outcome, use the Two Means section: enter the smallest difference worth detecting and the SD from pilot data or the literature, then set alpha and power.
  2. Read n per group (rounded up) and total N; enter an expected dropout % to get the inflated n per group, or enter an available n per group to get the smallest difference it can detect.
  3. For a binary outcome, use the Two Proportions section: enter p1 and p2 as decimals (0.30 = 30%), then set alpha and power.
  4. Read n per group (rounded up) and total N for the proportions calculation.

Two Means — sample size for a two-sample comparison

Normal-approximation formula: n per group = 2 × ((za + zb) × SD / difference)². Enter the smallest difference worth detecting and the SD from pilot data or the literature.

z for alpha/2
z for power
n per group (exact)
N PER GROUP (rounded up)
Total N (both groups)
n per group incl. dropout

B. Smallest detectable difference at fixed n

Smallest detectable difference

Two Proportions — sample size

Standard two-sided normal-approximation formula with the pooled variance under H0 for the alpha term. Enter proportions as decimals (0.30 = 30%).

z for alpha/2
z for power
Pooled proportion p-bar
n per group (exact)
N PER GROUP (rounded up)
Total N (both groups)
Prefer to work offline or keep a copy? The download link is right below.
Download the Sample Size & Power workbook (.xlsx)
Notes & limits (from the workbook): Two means: the normal approximation slightly under-recruits vs an exact t-test calculation at small n (below ~30/group, add 1–2 per group or use G*Power). Assumes equal SDs and equal group sizes; for a paired design use the SD of the differences and n = pairs. Two proportions: no continuity correction — with one, n rises a few percent. For rare events (p < 0.05) exact methods (Fisher-based) recruit differently; verify with G*Power or your stats package before writing the number into a protocol or grant.