Advanced maths

T test power and sample size calculator with effect size

Calculate noncentral-t power or minimum integer sample size for one-sample, paired or equal-variance independent t tests with signed standardized effect.

Your numbers

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Behind the numbers

How this calculation works

Power is the probability that a specified test rejects its null when a chosen population effect is true. It is a planning calculation conditional on that effect, not a confidence that a study will succeed. This page uses noncentral-t probabilities rather than a normal sample-size shortcut. One-sample and paired designs share the one-mean formula after defining the appropriate standard deviation; independent mode uses the pooled-variance two-group test. Sample-size mode searches integer first-group sizes and verifies the preceding size against the requested target.

THE FORMULAδ=d√n for one/paired; δ=d√(n₁n₂/(n₁+n₂)) for independent tests. Power integrates noncentral t beyond the central-t rejection threshold.

A worked example

For two independent groups of 30 people each, standardized mean difference d=0.5, alpha=0.05 and a two-sided alternative, the degrees of freedom are 58 and noncentrality is 0.5×sqrt(30×30/60)=sqrt(3.75), approximately 1.936492. The rejection threshold is the 97.5th percentile of central t with 58 degrees of freedom. Evaluating both noncentral tails gives power approximately 0.4778965. Target power 0.80 with equal allocation instead requires 64 observations per group under the same model.

Good to know

Signed standardized effect within ±5, alpha 0.001–0.2 and 2–10,000 observations per group. Size target must exceed alpha and be below 0.999; allocation n2/n1 ranges 0.1–10 with n2 rounded upward and bounded below by two. Numerical noncentral-t integration has explicit convergence/resource errors. Independent mode assumes equal population variances. No Welch, clustering, attrition, repeated interim looks, multiple-testing adjustment or guarantee that the assumed effect is realistic.

Standardize the effect using the design-specific variability

For a one-sample test, d is the population mean minus the null mean divided by the population standard deviation. For a paired test, it is the population mean paired difference divided by the standard deviation of paired differences. Substituting a marginal before-or-after standard deviation into the paired formula can substantially misstate power because correlation within pairs changes the variability of the difference.

For independent groups, d uses the common within-group population standard deviation in the pooled-variance model. The noncentrality combines this effect with both group sizes. Changing allocation can reduce power at fixed total size when all other assumptions are equal, but differing costs or recruitment constraints can justify an unequal ratio. The page preserves the declared ratio and rounding rule instead of silently replacing it with equal groups.

The independent t-test design turns sample sizes into a noncentrality parameterEffect d = 0.5n1 = n2 = 30δ = 0.5 × √15; df = 58Two-sided power ≈ 0.47880% target: 64 per group
For d=0.5 and n1=n2=30, degrees of freedom are 58 and δ=0.5 sqrt(15). A two-sided 0.05 test has power about 0.478. Under the same assumptions, equal group sizes of 64 meet target power 0.80; 63 do not.

Tail direction and integer boundaries are part of the plan

A positive effect helps a greater-than alternative and works against a less-than alternative. Two-sided power includes rejection in either direction; a large effect of either sign can therefore give high two-sided power. Fixed-size mode retains a signed effect even when it points away from a one-sided alternative, while size planning rejects that incompatible direction instead of searching for an impossible target by increasing the sample indefinitely.

Sample-size mode returns a first-group integer whose calculated power meets the target and checks that its predecessor does not. In independent mode the second group is ceil(allocation×n1), so both sizes can change at a step. This minimum is conditional on the supported model and rounding rule, not a universal design recommendation. The Survey sample size calculator plans a proportion margin of error; it does not use the rejection probability and noncentral distribution used by this t-test page.

A few questions, answered

Should I enter the effect estimated from my completed study?

This tool can evaluate any supported assumed effect, but observed post-hoc power is not independent evidence about a finished test. Planning should use a justified prospective effect and sensitivity analysis.

Does the required sample size include expected dropouts?

No. It is the analyzed sample under the stated model. Attrition, clustering and other design adjustments need their own justified calculation.

Find your calculator

Start typing to explore the library.