pubmed.info
Drag tiles by their title, resize at the bottom edge.

Sample size calculator for two groups

How many participants does your study need? Enter the expected proportions or the difference in means, choose significance level and power – the calculator shows the number per group and in total, including dropouts. Free, no account.

More about this tool

What you can do

  • Calculate the sample size for comparing two proportions (e.g. complication rate 60% versus 40%) or two means (expected difference and standard deviation).
  • Choose a two-sided significance level of 0.05 or 0.01 and a power of 80% or 90%.
  • Plan unequal groups with an allocation ratio n2 : n1, for example 2 for twice as many participants in group 2.
  • Add expected dropouts to get the number you need to recruit.

How it works

  • Outcome: two proportions or two means.
  • Proportions: expected proportion in group 1 and group 2, in percent.
  • Means: expected difference in means and standard deviation, in the same unit.
  • Significance level, power, allocation ratio and expected dropouts in percent.

The result updates as you type: n for group 1, n for group 2, total, and total including dropouts. Results are rounded up to whole participants.

Formulas and sources

Two-sided test with normal approximation. For proportions the formula without continuity correction after Fleiss, Levin and Paik (Statistical Methods for Rates and Proportions, 3rd ed., 2003) is used; for means n₁ = (1 + 1/k) (z₁₋α/₂ + z₁₋β)² σ² / Δ². Dropouts are added as n / (1 − dropout rate). With small samples a calculation based on the t distribution gives slightly larger numbers.

Data and privacy

The calculation runs entirely in your browser; nothing is sent to a server. Your last input is remembered only in this browser. The calculator is for orientation and does not replace statistical advice: check sample sizes for protocols, ethics and grant applications with a second software or a biostatistician.

Frequently asked questions

How many participants do I need to detect 60% versus 40%?

With a two-sided α of 0.05, 80% power and equal groups, the calculator gives 97 per group, 194 in total. Allowing for 10% dropouts, you would recruit 108 per group, 216 in total.

Where do I get the expected difference and standard deviation?

From pilot data, earlier studies or the smallest difference that would be clinically relevant. Overly optimistic assumptions lead to an underpowered study, so state your sources in the protocol.

Which test is the sample size for?

Both calculations are for comparing two independent groups with a two-sided test – two means (as with a t-test) or two proportions. Paired designs, more than two groups or survival outcomes need other methods.

pubmed.info sets no tracking cookies and builds no user profiles. Visits are counted anonymously (cookieless, shortened IP addresses). Ads from Google appear only according to your consent choice.