CalculatorsToolsGuides 日本語
BenchFig › Calculators › Sample size and power calculator
Free statistics calculators

Sample size and power calculator

Answer three questions in plain lab terms and the required n appears instantly. The calculations use the exact noncentral t and F distributions and reproduce the published examples of G*Power and the R pwr package.

Updated: BenchFig日本語

Your numbers are processed only in this browser. Nothing is sent to a server (it is gone when you close the page).

1What are you comparing?
2What difference do you expect?

Use values from a pilot experiment or a paper. Enter the SD, not the SEM, and it should be the spread of biological replicates (animals, independent experiments). If the SDs differ, enter both (the root mean square of the two SDs is used).

3Set the criteria
Significance α
Test
Power

Adds a margin for animals lost or failed cultures. Enter a planned n to see its power and the smallest effect it can detect.

How to use it

  1. Choose what you compare. Separate animals or samples: “Two separate groups”; the same subjects before/after or experiments run side by side: “Before/after or pairs”; three or more: “Three or more groups”; yes/no outcomes: “Proportions”.
  2. Enter the difference you expect. Type the means and SD from a pilot experiment or a paper; the effect size is computed for you.
  3. Choose α and power. Usually α = 0.05 (two-sided) and 80% or 90% power. Add the expected dropout in %.

You get the required n, a power curve (power as n changes), power at common sizes (3, 4, 5, 6…), a ready-to-paste Methods sentence and the calculation details (df, critical value, noncentrality).

Choosing the expected difference

ApproachWhenWatch out for
Pilot dataYou ran a small version in the same systemSmall pilots tend to overestimate the effect (you go ahead because the difference looked big), and their SD is uncertain
A previous studyA paper used the same or a similar systemIf error bars are SEM, convert: SD = SEM × √n. Check what n counted (cells or animals)
Smallest meaningful differenceYou can say “a smaller difference would not matter”The most honest choice, e.g. “at least a 10% change in body weight”

Cohen’s conventions (d: 0.2 small, 0.5 medium, 0.8 large) came from behavioral science; differences in cell and animal experiments are often larger. Real means and SDs are more reliable than conventions.

Key points
  • Use the SD, not the SEM. An SEM makes the effect look √n times larger and gives too small an n
  • The SD must describe biological replicates. The SD of repeated measurements of the same sample (technical replicates) is far too small
  • Try a few scenarios and check that n is still adequate on the dashed curve (effect only 3/4 as large)

What n counts

The n here is the number of experimental units — the smallest units that independently receive the treatment: animals (or cages, if diet is given per cage), independent experiments for cultured cells, biological samples for qPCR — not cells or the three wells of one sample. Counting cells as n makes P values misleadingly small (pseudoreplication); see what n counts: biological vs technical replicates and pseudoreplication and SuperPlots.

What α and power mean

MeaningUsual value
Significance level αThe rate of calling a difference significant when there is none0.05 (two-sided)
Power 1 − βThe chance of a significant result when the expected difference really exists80% or 90%

80% power means that even if the expected difference is real, one experiment in five will miss it. When you want to use fewer animals, an underpowered study is the most wasteful option, because it often has to be repeated. Use a one-sided test only if you decided before the experiment that a difference in the other direction is of no interest.

Common mistakes

Reporting it

ARRIVE 2.0 (the reporting guideline for animal research) asks in item 2b how the sample size was decided and for details of any a priori calculation. The generated sentence states the test, α, power, the expected difference and its source, the required n and the dropout margin. For the whole statistics paragraph see how to write the statistical analysis section, and check your manuscript with the statistics checklist.

Methods and validation

For the two-sample t test with n per group, power uses the noncentral t distribution with 2n − 2 degrees of freedom and noncentrality δ = d·√(n/2), including rejections in the opposite direction for two-sided tests (as G*Power and R’s pwr). The paired t test uses n − 1 df and δ = dz·√n. One-way ANOVA with k groups of n uses F(k − 1, kn − k) and the noncentral F distribution with λ = f²·kn (f = SD of the group means / SD). Two proportions use the same normal approximation as R’s power.prop.test (no continuity correction). The required n is the smallest whole number reaching the target power (as in G*Power); the unrounded n returned by pwr and R is shown under “Calculation details”.

The table compares the calculator with published examples (the values are recomputed by this calculator every time the page is built). In addition, about 360 t-test and ANOVA power values were compared with SciPy 1.18 nct and ncf (an independent implementation; proportions were recomputed with the same formula in Python); the largest difference was about 1 × 10⁻¹⁰.

SourceExampleQuantityPublishedThis calculator
G*Power 3.1 manual §1.2.3t (unpaired), one-sided, d = 0.5, α = .05, power .95n per group8888
pwr (R) vignettepwr.t.test(n = 30, d = 0.5)power0.47789650.4778965
pwr (R) vignettepwr.t.test(d = 0.5, power = 0.80)n63.7656163.76561
pwr (R) vignettepwr.t2n.test(n1 = 28, n2 = 35, d = 0.5)power0.49245880.4924588
G*Power 3.1 manual §19.3paired, dz = 0.421637, N = 50, two-sidedpower0.8321140.832114
G*Power 3.1 manual §19.3paired, dz = 0.2828427, N = 50, two-sidedpower0.5003520.500352
pwr (R) vignettepwr.t.test(n = 24, d = 0.32, paired, greater)power0.45086910.4508691
pwr (R) vignettepwr.t.test(d = 0.32, power = 0.8, paired, greater)n61.7520961.75209
G*Power 3.1 manual §10.3ANOVA, k = 10, f = 0.25, α = .05, power .95total N390390
G*Power 3.1 manual §10.3(same) actual powerpower0.9523630.952363
pwr (R) vignettepwr.anova.test(k = 3, f = 0.25, α = .01, power = 0.9)n94.4871494.48713
R statspower.anova.test(groups = 4, n = 5, between.var = 1, within.var = 3)power0.35355940.3535594
R statspower.anova.test(means 120, 130, 140, 150, within.var = 500, power = .90)n15.1883415.18833
R statspower.prop.test(n = 50, p1 = .50, p2 = .75)power0.7400.740
R statspower.prop.test(p1 = .50, p2 = .75, power = .90)n76.776.7
R statspower.prop.test(p1 = .90, p2 = 1.0, power = 0.8)n73.3773.37

Sources: G*Power 3.1 Manual (Heinrich-Heine-Universität Düsseldorf), the pwr package vignette (Champely et al.), and the examples of power.anova.test and power.prop.test in R’s stats package. The n values from pwr and R are numerical root-finding results; differences around the fourth decimal are within their tolerance.

FAQ

Does it give the same results as G*Power?

Yes. The two-sample and paired t tests and one-way ANOVA use the same definitions as G*Power (effect sizes d, dz and f; noncentral t and F distributions) and reproduce the examples in the G*Power 3.1 manual. For two proportions, the method is the normal approximation of R’s power.prop.test (G*Power lets you choose a z test or Fisher’s exact test; analysis by Fisher’s exact test needs a somewhat larger n than shown here).

Isn’t n = 3 enough?

Only for very large effects (d above about 3). For typical effects, power at n = 3 is low. Check power at n = 3, 4, 5… in the result.

What if I want unequal group sizes?

This calculator assumes equal n per group. For a fixed total, equal groups give the highest power.

What about experiments that were not planned this way?

Do not compute power afterwards. Describe honestly how n was chosen and report confidence intervals; use this calculator to plan the next experiment.

Is my data sent anywhere?

No. Everything runs in your browser and nothing is sent to a server.

After the experiment: graphs and testsBar and dot plots, error bars and significance asterisks at journal quality, with t tests, ANOVA and multiple comparisons.
Open for free →

Other calculators

Related guides

Product names are trademarks or registered trademarks of their respective owners.