Sample Size Calculator — Two-Group Mean Test (Power & α)

Estimate minimum sample size per group for comparing two independent means. Private by design—everything runs locally in your browser.

Inputs

(e.g., 0.80)
(two-tailed)
(same units as means)
(pooled SD)

Results

Minimum Sample Size
Per group:   |   Total (both groups):
Two-tailed test; equal variances and equal group sizes assumed.
Details
Cohen’s d:
Z1−α/2:   |   Zpower:
Formula: \( n = \dfrac{2\,(Z_{1-\alpha/2}+Z_{1-\beta})^2}{d^2} \) where \( d = \Delta/\sigma \).

How This Sample Size Calculator Works

This scientific sample size calculator is a quick, practical guide for planning studies that compare two independent groups. It estimates how many observations you need in each group to reliably detect a meaningful difference in means. In other words, it helps you answer a common research question: "How many samples do I need for my study to have enough statistical power?"

The calculation is based on a two-sample mean test with equal group sizes and equal variances, using a standard normal approximation commonly taught in introductory statistics and power analysis. You specify the minimum difference you want to detect (Delta), an estimate of the standard deviation, your chosen significance level (alpha), and the desired power (1 minus beta). The calculator then returns the minimum sample size per group, along with helpful supporting values like Cohen's d and the Z-scores used in the formula.

How to use it

  1. Pick a target power, such as 0.80 or 0.90, to reflect how confident you want to be in detecting a true effect.
  2. Choose a significance level (alpha), often 0.05 for a two-tailed test, to control the false-positive rate.
  3. Enter the smallest difference in means that would matter for your question.
  4. Estimate the standard deviation from prior studies, published results, or a pilot sample.
  5. Click Calculate to see the required sample size per group and the total across both groups.

Why it matters

Sample size planning is essential in scientific research, product testing, and A/B experiments because too few observations can miss real effects, while too many can waste time and resources. This calculator is useful for planning clinical trials, lab experiments, psychology studies, and quality control comparisons where two independent groups are analyzed.

Keep in mind that this is a simplified two-sample design. It assumes equal group sizes and equal variances, and it does not model paired designs or more complex ANOVA settings. For those cases, you would use a specialized power analysis tool. As a fast planning reference, though, it provides a reliable starting point for determining a reasonable sample size.

Frequently Asked Questions

Can I use Cohen’s d directly?

Yes. If you know d, set Δ = d × σ or set σ = 1 and enter Δ = d.

Two-tailed vs one-tailed?

This calculator uses a two-tailed test (Z1−α/2). For a one-tailed test, replace Z1−α/2 with Z1−α.

Are inputs and results stored?

No. All computations run locally in your browser.

5 Fun Facts about Sample Size & Power

80% power is a social norm

The famous 0.80 power “standard” traces to Jacob Cohen’s 1988 book—not math necessity. Some fields now push for 0.90+ when stakes are high.

Tradition vs. need

Precision rises slowly

Doubling n does not halve your standard error—it shrinks by √2. Big gains come early; later gains are pricier.

Diminishing returns

Unbalanced groups cost you

A 2:1 allocation saves budget but bumps required totals. The effective sample size scales with the harmonic mean of group sizes.

Design trade-off

Small pilots mislead variance

Underpowered pilots tend to underestimate σ, making follow-up studies underpowered too. Add a cushion or use priors/meta-data.

Pilot trap

Effect size is the power lever

Power ∝ (Δ/σ)2: halving SD or doubling Δ cuts required n roughly four-fold. Sometimes better measurement beats more participants.

Bigger signal

Explore more tools