# How to Calculate Sample Size in G*Power: t-Tests, ANOVA and Correlation

G*Power is a free power analysis program from Heinrich-Heine-Universitat Dusseldorf, developed by Buchner, Erdfelder, Faul and Lang. It runs on Windows and macOS, costs nothing for any user including commercial labs, and covers t tests, F tests, chi-square tests, z tests and some exact tests [1]. If you have ever finished a study and wondered whether you had enough participants to detect the effect you cared about, G*Power is the tool that answers that question before you collect data.

This guide walks through the three designs you will meet most often in undergraduate and graduate research: the two-group t test, the one-way ANOVA and the bivariate correlation. By the end you will be able to run an a priori power analysis in G*Power, read the output correctly, inflate your sample for dropout, and check the result against Python so you can report a number you trust.

## Quick Answer

- Download G*Power from the official page. As of October 2026 the listed builds are G*Power 3.1.9.7 for Windows and G*Power 3.1.9.6 for macOS; check the download page for the current release [1].
- Open the program and pick the test family that matches your design: `t tests`, `F tests` or `Exact` [2].
- Choose the statistical test from the dropdown, for example `Means: Difference between two independent means (two groups)` [2].
- Set `Type of power analysis` to the `A priori` option, which computes the sample size you need from alpha, power and effect size [2].
- Enter your effect size (Cohen's d, f or rho), alpha, power and any design inputs such as the number of groups, then click `Calculate` [2].
- Divide the required n by (1 minus your expected dropout rate) before you start recruiting.

## Step 1: Install G*Power and Know What You Are Getting

The download page hosts the Windows and macOS installers, plus the official G*Power 3.1 manual PDF dated June 1, 2023 [1][2]. There is no Linux version listed [1], so Linux users can do the calculation in R or Python instead. The macOS build is compiled for Intel processors. The developers note that Intel apps remain supported until macOS 28, expected in fall 2027, and that G*Power 4, a native Apple silicon version, is in development [1]. If you are on an M-series Mac, the current build still runs, but plan for the transition.

Version numbers change, so treat the ones above as a snapshot. The manual is the authoritative source for menu labels and input definitions, and it is worth keeping the PDF open in a second window while you work [2].

When you publish, cite the program properly. The developers ask users to cite Faul et al. 2007 for G*Power 3 and Faul et al. 2009 for the correlation and regression tests added in version 3.1 [1][3][4].

## Step 2: Understand the Three-Step Workflow

Every analysis in G*Power follows the same logic, described in the manual as three steps: select the statistical test appropriate for your problem, choose one of the five types of power analysis, then provide the input parameters and click `Calculate` [2].

The five types of power analysis are worth knowing by name because they answer different questions [2]:

- **A priori**: computes N from power, alpha and effect size. This is the one you use when planning a study.
- **Compromise**: computes alpha and power from effect size, N and the ratio q = beta/alpha.
- **Criterion**: computes alpha from power, effect size and N.
- **Post hoc**: computes power from alpha, effect size and N.
- **Sensitivity**: computes the effect size you could detect from alpha, power and N.

For planning, you want the `A priori` option [2].

## Step 3: Run a Two-Group t Test

Set `Test family` to `t tests` and `Statistical test` to `Means: Difference between two independent means (two groups)` [2]. The input fields are `Tail(s)`, `Effect size d`, `alpha err prob`, `Power (1-beta err prob)` and `Allocation ratio N2/N1` [2].

Cohen's conventions for d, as stated in the manual, are small 0.20, medium 0.50 and large 0.80 [2]. Those benchmarks are a starting point for thinking about magnitude, not a substitute for judgment. Lakens's open textbook states plainly that Cohen's benchmarks should not be used in an a priori power analysis, and notes that Cohen himself regretted proposing them [6]. The better practice is to justify the effect size you enter: the smallest effect you would care about detecting, an estimate from prior work in your specific paradigm, or a value tied to a practical decision threshold [5].

If you have means and a standard deviation instead of a d, click the `Determine` button. A side panel opens where you enter the two means and the common standard deviation, and G*Power computes Cohen's d = |mu1 - mu2| / sigma [2]. Means of 10 and 12 with an SD of 4 give d = |10 - 12| / 4 = 0.5. This is the same d you would compute by hand, so the button is a convenience, not a black box.

The `Allocation ratio N2/N1` field matters when your groups will not be equal. Leave it at 1 for equal groups. If your design forces a 2:1 split, enter 2 and G*Power will size the two groups accordingly.

## Step 4: Run a One-Way ANOVA

Set `Test family` to `F tests` and `Statistical test` to `ANOVA: Fixed effects, omnibus, one-way` [2]. The extra input beyond the usual alpha, power and effect size is `Number of groups` [2]. Cohen's conventions for f are small 0.10, medium 0.25 and large 0.40 [2].

The `Determine` panel for ANOVA is more flexible than the t test version. You can enter a common standard deviation along with the mean and size of each group, compute f from variances (variance explained and variance within groups), or enter eta squared directly [2]. That last option is useful when a published paper reports eta squared but not f, since you can convert without leaving the program.

One detail that trips people up: the total N that G*Power returns for ANOVA is the total across all groups, not the per-group n. If the total is not divisible by the number of groups, you round up to the next multiple so the groups stay equal. The worked example below shows this in action.

## Step 5: Run a Correlation Power Analysis

Correlation lives under a different test family. Set `Test family` to `Exact` and `Statistical test` to `Correlation: Bivariate normal model` [2]. The inputs are `Correlation rho H1` and `Correlation rho H0`, where rho H0 is 0 for a test against no correlation [2]. Cohen's conventions for rho are small 0.1, medium 0.3 and large 0.5 [2].

The reason correlation sits under `Exact` and not under `t tests` is that G*Power uses the exact sampling distribution of Pearson r under a bivariate normal model, not the Fisher z approximation. The two give slightly different answers, and the exact test is the more accurate one. The worked example shows a case where the approximation overshoots by one participant.

## Step 6: Read the Output and Inflate for Attrition

The output panel reports the computed values, including the total sample size and the actual power. Two numbers deserve your attention. First, `Actual power` may be slightly above your target, because the required N is rounded up to a whole number. Second, `Total sample size` is what you need at analysis time, with complete data.

Real studies lose participants. If you expect 15% dropout, divide the required n by 0.85. A requirement of 64 per group becomes 64 / 0.85 = 75.3, so you recruit 76 per group, 152 total. This adjustment is standard practice and applies to any design.

G*Power can also export the full details of an analysis, which matters because Lakens recommends that an a priori power analysis be reported in a fully reproducible way [6]. Save the output or screenshot the window with every input visible, and keep it with your analysis notes.

## Worked Example

Three calculations, checked against Python with statsmodels 0.15.0 and scipy. For a quick check in your browser, you can also try our [Sample Size Calculator](/tools/sample-size-calculator). The G*Power menu paths are given for each so you can reproduce them.

**(a) Two-group t test.** Test family `t tests`, statistical test `Means: Difference between two independent means (two groups)`, `A priori`, Tail(s) Two, Effect size d 0.5, alpha err prob 0.05, Power 0.80, Allocation ratio N2/N1 1, then `Calculate`. G*Power returns 64 per group, 128 total.

```python
from statsmodels.stats.power import TTestIndPower
TTestIndPower().solve_power(effect_size=0.5, alpha=0.05, power=0.80,
                            ratio=1, alternative='two-sided')  # 63.77 -> 64 per group, 128 total
```

Power at n = 64 per group is 0.8015; at 63 per group it is 0.7952. The rounding is what buys you the extra fraction.

For comparison, the same inputs with a one-tailed test give 50.15, rounded up to 51 per group. That difference is exactly why switching to a one-tailed test after seeing your data is not acceptable. The direction has to be justified in advance.

**(b) One-way ANOVA.** Test family `F tests`, statistical test `ANOVA: Fixed effects, omnibus, one-way`, `A priori`, Number of groups 3, Effect size f 0.25, alpha err prob 0.05, Power 0.80. G*Power reports 159 total.

```python
from statsmodels.stats.power import FTestAnovaPower
FTestAnovaPower().solve_power(effect_size=0.25, alpha=0.05, power=0.80, k_groups=3)  # 157.19 total
```

N = 158 already reaches power 0.8022, but 158 is not divisible by 3. With equal groups you need 53 per group, which is 159 total and power 0.8049. A cross-check with scipy's noncentral F distribution (noncentrality lambda = f^2 x N total, df1 = k - 1, df2 = N - k) gives the same power values, which also confirms that statsmodels' `nobs` is the total sample size, not the per-group size.

**(c) Correlation.** Test family `Exact`, statistical test `Correlation: Bivariate normal model`, `A priori`, Correlation rho H1 0.3, Correlation rho H0 0, alpha 0.05, Power 0.80, two-tailed. G*Power returns N = 84.

An exact calculation using the sampling distribution of Pearson r under a bivariate normal model gives power 0.7955 at N = 83 and 0.8003 at N = 84, so 84 is the answer. The common Fisher z approximation, N = ((z_.975 + z_.80) / atanh(0.3))^2 + 3, gives 84.93, rounded up to 85. The approximation costs you one participant here. It is not a disaster, but it shows why the exact test is the better default when G*Power offers it.

**Manual cross-checks.** The G*Power manual includes two examples you can reproduce: a one-tailed two-group t test with d = 0.5, alpha = .05 and power = .95 gives N = 176 (88 per group), and a one-way ANOVA with 10 groups, f = .25, alpha = .05 and power = .95 gives 390 total (39 per group) [2]. Both reproduce in statsmodels: `TTestIndPower` with `alternative='larger'` gives 87.26 per group, and `FTestAnovaPower` with `k_groups=10` gives 385.98 total, which rounds up to 39 x 10 = 390.

## Common Mistakes and How to Fix Them

- **You read the total N as the per-group n.** Symptom: you plan to recruit far more participants than the design needs. Cause: for ANOVA the output N is the total across all groups, and for correlation it is the number of pairs. Fix: read the label on the output row, and for ANOVA divide by the number of groups to get the per-group n.
- **You used a post hoc power analysis to defend a completed study.** Symptom: observed power comes out near 0.50 when your p-value is close to .05. Cause: for a two-sided z test, observed power computed from the observed effect is a fixed function of the p-value, about 0.50 at p = .05, 0.25 at p = .20 and 0.73 at p = .01. Fix: report the effect size and its confidence interval instead. Post hoc power adds almost nothing.
- **You switched to a one-tailed test after seeing the direction.** Symptom: the required N drops by roughly 20%. Cause: one-tailed tests put all alpha in one tail. Fix: decide the tail before data collection and justify the direction from theory or prior work.
- **You used Cohen's medium effect because you had no better number.** Symptom: a reviewer asks why d = 0.5. Cause: Lakens argues the benchmarks should not be used in an a priori power analysis [6]. Fix: define the smallest effect size of interest, or use an estimate from a meta-analysis while acknowledging that publication bias can inflate published effects [5][6].
- **You forgot attrition.** Symptom: you finish data collection with fewer complete cases than the power analysis required. Cause: the a priori N is the analysis sample, not the recruitment target. Fix: divide by (1 minus the expected dropout rate) before you open enrollment.
- **You copied an effect size from a meta-analysis without checking its bias.** Symptom: your study is underpowered despite matching the published estimate. Cause: publication bias can make meta-analytic estimates substantially larger than the true effect [6]. Fix: run a sensitivity analysis with a smaller effect size and see how N changes.

## Limitations

G*Power covers a wide range of tests, but it is not a general-purpose modeling tool. Mixed models, multilevel designs, complex structural equation models and most Bayesian designs are outside its scope. For those, you will need R packages, simulation, or dedicated software.

Platform support has real gaps. There is no Linux build [1]. The macOS build is Intel-only, and while the developers say Intel apps remain supported until macOS 28 (expected fall 2027), Apple silicon users are waiting on G*Power 4 [1]. Version numbers and release dates change, so verify the current download before you cite a version in a methods section.

The program computes what you ask it to compute. If you enter an effect size that is too large, it will return a sample size that is too small, and it will do so with a clean output panel that looks authoritative. The statistical machinery is sound; the input is your responsibility. A power analysis is a justification, not a guarantee, and Lakens describes several other legitimate ways to justify a sample size, including planning for accuracy and working within resource constraints [5].

Finally, G*Power's output values in this article were reproduced in Python and not read off the program itself. The manual examples match, which is reassuring, but if you need a number for a preregistration, run it in G*Power and export the analysis.

## Frequently Asked Questions

### What is G*Power used for?

G*Power is a free program for statistical power analysis. It computes the sample size you need for a planned study, the power you have given a sample size, or the effect size you could detect, across t tests, F tests, chi-square tests, z tests and some exact tests [1]. Most users reach for it during study planning.

### How do I download G*Power?

Go to the official page at Heinrich-Heine-Universitat Dusseldorf and pick the installer for your operating system [1]. As of October 2026 the listed builds are 3.1.9.7 for Windows and 3.1.9.6 for macOS, with no Linux version [1]. Check the page for the current release before you download.

### What is an a priori power analysis?

An a priori power analysis computes the sample size required to detect a given effect, at a given alpha, with a given probability [2]. It is the type of analysis you run before collecting data. The other four types in G*Power answer different questions, such as what power you had after the fact or what effect size your sample could detect.

### How do I choose an effect size for G*Power?

Start from the smallest effect you would care about detecting, or from an estimate in prior work using the same paradigm [5]. Cohen's conventions (d = 0.20, 0.50, 0.80; f = 0.10, 0.25, 0.40; rho = 0.1, 0.3, 0.5) are stated in the manual [2], but Lakens argues they should not be used in an a priori power analysis [6]. If you use a meta-analytic estimate, remember that publication bias can inflate it [6].

### Can I use G*Power for ANOVA?

Yes. Set `Test family` to `F tests` and choose `ANOVA: Fixed effects, omnibus, one-way` for a one-way design, then enter the number of groups along with alpha, power and f [2]. The output is the total sample size across all groups, so divide by the number of groups to plan each arm.

## References

1. [G*Power official page, Heinrich-Heine-Universitat Dusseldorf](https://www.psychologie.hhu.de/arbeitsgruppen/allgemeine-psychologie-und-arbeitspsychologie/gpower)
2. [G*Power 3.1 manual (PDF, June 1, 2023)](https://www.psychologie.hhu.de/fileadmin/redaktion/Fakultaeten/Mathematisch-Naturwissenschaftliche_Fakultaet/Psychologie/AAP/gpower/GPowerManual.pdf)
3. [Faul F et al. 2007. G*Power 3: A flexible statistical power analysis program for the social, behavioral, and biomedical sciences. Behav Res Methods 39:175-191](https://doi.org/10.3758/BF03193146)
4. [Faul F et al. 2009. Statistical power analyses using G*Power 3.1: Tests for correlation and regression analyses. Behav Res Methods 41:1149-1160](https://doi.org/10.3758/BRM.41.4.1149)
5. [Lakens D. 2022. Sample Size Justification. Collabra: Psychology 8:33267](https://doi.org/10.1525/collabra.33267)
6. [Lakens D. Improving Your Statistical Inferences, Chapter 8: Sample Size Justification](https://lakens.github.io/statistical_inferences/08-samplesizejustification.html)
7. [statsmodels documentation: TTestIndPower.solve_power](https://www.statsmodels.org/stable/generated/statsmodels.stats.power.TTestIndPower.solve_power.html)

## Related Articles

- [G*Power vs. R for Sample Size Calculation: Which Tool Should You Use?](/knowledge/diagnostics/research-methods/g-power-vs-r-for-sample-size-calculation-which-tool-should-you-use)
- [Software for Power Analysis and Sample Size Calculation in Life Sciences](/knowledge/bioinformatics/software-for-power-analysis-and-sample-size-calculation-in-life-sciences-r-g-power-pass-and-python-c)
- [How to Read Effect Size in Research Papers](/blog/research-skills/effect-size-explained-how-to-measure-the-magnitude-of-a-finding-without-getting-lost-in-p-values)
- [How to Calculate a One-Way ANOVA: Worked Example With Welch F and Tukey HSD](/blog/research-skills/how-to-calculate-one-way-anova)
- [How to Install R and RStudio on Windows, Mac and Linux](/blog/research-skills/how-to-install-r-and-rstudio)