Sample Size Calculator for t Tests

Estimate participants for powerful one-sample, paired, and independent t tests. Adjust assumptions before recruitment begins. Design stronger studies with clear, practical statistical guidance today.

Set Study Assumptions

Fields adapt to your selected t test design and effect-size format.

Choose the design used for the primary mean comparison.
Use one-sided only for a pre-specified directional question.
Use raw values when your expected units are known.
Common value: 0.05.
Common values: 0.80 or 0.90.
Inflates recruitment targets after the analysis size is calculated.
Use the expected absolute standardized difference.
Enter the absolute difference that matters in your units.
Expected standard deviation for the single sample.
Standard deviation before treatment or at first measurement.
Standard deviation after treatment or at second measurement.
Higher positive correlation usually reduces the required pairs.
Welch planning uses an approximate degrees-of-freedom adjustment.
Expected variability in the first independent group.
Expected variability in the second independent group.
1 means equal groups. A ratio of 2 means twice as many in Group 2.

Example Planning Data

A researcher plans a two-sided independent t test. They expect a moderate standardized effect and want attrition included before recruitment begins.

Planning item Example input Why it matters
Test design Independent two-sample Compares mean outcomes for separate groups.
Effect size Cohen's d = 0.50 Represents the expected mean difference relative to variability.
Alpha and power 0.05 and 0.80 Balances false-positive risk with sensitivity.
Allocation ratio 1 : 1 Keeps both groups equally sized.
Expected dropout 10% Increases the recruitment target after analysis needs are known.

Formula Used

For a one-sample or paired t test, the starting relationship is:

n ≈ ((tcritical + zpower) × σ / Δ)2

For independent groups with allocation ratio r = n2 / n1, the starting relationship is:

n1 ≈ (tcritical + zpower)2 × (σ12 + σ22/r) / Δ2

The calculator iterates the t critical value with the estimated degrees of freedom. It rounds each result upward. For paired raw inputs, σ is the standard deviation of paired differences: √(σ12 + σ22 − 2ρσ1σ2).

How to Use This Calculator

  1. Select the t test that matches the study design.
  2. Choose a one-sided or two-sided alternative hypothesis.
  3. Set alpha, target power, and expected dropout.
  4. Enter Cohen's d, or enter a raw difference with variability values.
  5. For independent groups, set the variance model and allocation ratio.
  6. Calculate, then use the recruitment target rather than only the analysis size.
  7. Export the result when documenting the study protocol.

Planning Reliable t Test Studies

Sample size planning protects a t test from weak conclusions. A study can miss an important effect when too few observations are collected. It can also waste time when recruitment exceeds the required target. This calculator estimates a practical starting number for common t test designs.

The key assumption is the effect size. Cohen’s d expresses the expected difference relative to variability. A larger absolute d needs fewer observations. A smaller d needs more observations. Use prior studies, pilot data, or a meaningful practical difference to choose this value. Avoid selecting an optimistic number merely to reduce recruitment.

The selected significance level controls the chance of a false positive. A two-sided test usually uses alpha of 0.05. A one-sided test needs a clear directional hypothesis before data collection. The target power is the probability of detecting the assumed effect when it exists. Many studies use 80% or 90% power.

Choose the design that matches your data. A one-sample test compares one mean with a reference value. A paired test compares linked measurements, such as before and after readings. Correlation between paired values may reduce the standard deviation of the change. An independent test compares separate groups. Its allocation ratio can reflect unequal recruitment plans.

Enter direct Cohen’s d when the standardized effect is already known. Choose raw values when you know expected means and standard deviations. For paired studies, provide both standard deviations and their expected correlation. For independent groups, the calculator can use equal or unequal variability assumptions.

The calculation iterates a t critical value using the estimated degrees of freedom. It then rounds each group upward. A dropout allowance increases the recruitment target after the analytical sample is found. Treat the result as a planning estimate. Check protocol constraints, missing-data risks, and ethics requirements before setting the final target.

Sensitivity checks are useful. Test several plausible effects, dropout rates, and allocation ratios. Record the assumptions and data sources. This makes later review easier and helps teams distinguish planning choices from study outcomes.

Review the result table and power curve. The curve shows how planned sample size changes across effect sizes. Export a CSV for records or a PDF for a protocol appendix. Recalculate whenever assumptions change. Transparent assumptions make the final study easier to assess and reproduce.

Frequently Asked Questions

What is a t test sample size calculator?

It estimates how many observations a mean-comparison study needs. The estimate depends on the expected effect, variability, alpha, target power, test direction, and study design.

What does Cohen's d mean?

Cohen's d is the expected mean difference divided by a standard deviation. It places effects on a common scale. Values near 0.20, 0.50, and 0.80 are often described as small, medium, and large, but context should guide interpretation.

Should I use a one-sided or two-sided test?

Use a two-sided test unless a single direction was justified before data collection. A one-sided test can require fewer observations, but it cannot test an unexpected difference in the opposite direction.

Why does higher power increase the sample size?

Higher power reduces the chance of missing the assumed effect. Greater sensitivity requires more information, which usually means more observations or more precise measurements.

How does dropout affect recruitment?

Dropout does not change the analytical sample needed. It increases the number recruited at the start. The calculator divides each analysis target by the expected retention proportion and rounds upward.

When should I use the paired t test option?

Use it when each observation has a meaningful partner. Examples include before-and-after measurements for the same person or matched pairs. The correlation between paired measurements can materially change the required number of pairs.

What is the allocation ratio?

It is Group 2 divided by Group 1. A value of 1 uses equal groups. Unequal allocation may be necessary when one group is harder or more expensive to recruit.

Should I choose equal or unequal variances?

Choose equal variances when similar variability is well supported. Choose unequal variances when group spreads may differ. Welch planning is usually a cautious option when the equality assumption is uncertain.

Can I enter raw units instead of Cohen's d?

Yes. Select raw values, then enter the meaningful mean difference and expected standard deviations. The calculator converts those values into a standardized effect for reporting.

Is this calculation exact?

It is an iterative planning approximation using t critical values and estimated degrees of freedom. It is useful for protocol design, but specialized software or statistical review is prudent for complex, regulated, or adaptive studies.

What should I report in a protocol?

Report the test design, alpha, sidedness, target power, expected effect, variability source, allocation ratio, attrition allowance, calculated analysis sample, and planned recruitment target.


Related Calculators

Paver Sand Bedding Calculator (depth-based)Paver Edge Restraint Length & Cost CalculatorPaver Sealer Quantity & Cost CalculatorExcavation Hauling Loads Calculator (truck loads)Soil Disposal Fee CalculatorSite Leveling Cost CalculatorCompaction Passes Time & Cost CalculatorPlate Compactor Rental Cost CalculatorGravel Volume Calculator (yards/tons)Gravel Weight Calculator (by material type)

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.