Opens in a new tab

CALCULATOR · SAMPLE SIZE & POWER

Sample Size Calculator for Research Studies

Enter the difference you expect, the variability, the alpha and the power. The sample size, a plain reading of it and a sentence for your protocol update as you type. Nothing you enter leaves your browser.

Runs in your browser. No data is sent or stored.

Method reviewed by an in-house statistician · Last checked November 2026

In Short

A sample size calculation turns four planning decisions into a number of participants: the smallest difference worth detecting, how variable the outcome is, the risk of a false positive you accept (alpha) and the chance of detecting the difference if it is real (power). This calculator covers the four most common designs: two independent means, two proportions, one proportion or survey estimate, and a correlation. The number it returns is only as good as the difference and the variability you enter, which is why those two inputs deserve a source.

How It Is Calculated

For two independent means the textbook formula uses the normal approximation:

FORMULA · TWO INDEPENDENT MEANS

n₁ = (1 + 1/r) · σ² · (z₁₋α/₂ + z₁₋β)² / δ² n₂ = r · n₁

δ = expected difference between means · σ = common standard deviation · α = two-sided significance level · 1 − β = power · r = allocation ratio n₂ : n₁ · z = standard normal quantile. The result is rounded up, then inflated for dropout as n / (1 − dropout).

The number shown in the result panel is slightly more exact than this formula: it searches whole-number group sizes and checks the achieved power of the two-sided t-test using the noncentral t distribution, which is what G*Power does (Faul et al., 2007). At small samples that adds one or two participants per group; at large samples the two agree. When you enter two different standard deviations, the search uses the Welch t-test with Satterthwaite degrees of freedom.

For two proportions the Fleiss formula is used, with the variance pooled under the null hypothesis and unpooled under the alternative; the continuity correction is optional and available for 1 : 1 allocation only (Fleiss et al., 2003):

FORMULA · TWO PROPORTIONS

n = [ z₁₋α/₂ · √(2 p̄ (1 − p̄)) + z₁₋β · √(p₁(1 − p₁) + p₂(1 − p₂)) ]² / (p₁ − p₂)²

p₁, p₂ = expected proportions · p̄ = (p₁ + p₂)/2.

For a survey estimate the margin-of-error formula with the finite population correction applies (Cochran, 1977):

FORMULA · SURVEY ESTIMATE

n₀ = z² · p(1 − p) / e² n = n₀ / (1 + (n₀ − 1)/N)

e = margin of error · p = expected proportion (0.5 if unknown) · N = population size, if finite.

For a correlation the Fisher z transformation gives (Hulley et al., 2013):

FORMULA · CORRELATION

n = [ (z₁₋α/₂ + z₁₋β) / C ]² + 3 C = 0.5 · ln((1 + ρ)/(1 − ρ))

Assumptions and When Not to Use It

  • Independent groups. Each participant appears once. For before-and-after measurements on the same people, see Pre-Post Study Design: Types and Analysis Options; the required n is usually smaller.
  • No clustering. Participants recruited in clinics, classrooms or households are more alike than strangers; inflate the result with the Design Effect Calculator.
  • Equal standard deviations unless you enter two; a continuous outcome analyzed with a t-test or an equivalent model.
  • Two-sided test at the alpha you set. One-sided and non-inferiority designs use a different calculation; see Non-Inferiority Sample Size Calculator.
  • Proportions strictly between 0 and 1. Near 0 or 1, exact methods may be preferable.
  • The inputs are planning assumptions. A difference or SD taken from a small pilot carries its own uncertainty.

Worked Example (Hypothetical Values)

A trial compares a symptom score at week 12 between two groups. The team considers a 5-point difference the smallest worth detecting, a previous study reported an SD of 12, and they plan for 80% power at a two-sided alpha of 0.05 with 10% dropout.

Input Value
Expected difference δ 5 points
Standard deviation σ 12 points
Alpha, two-sided 0.05
Power 0.80
Allocation 1 : 1
Dropout 10%
Normal formula 91 per group
t-based search (shown) 92 per group, achieved power 0.803
To recruit 103 per group, 206 in total

Press “Load the worked example” under the calculator and these values fill the fields. HYPOTHETICAL VALUES.

What the Result Still Needs

  1. 1
    A defensible difference. The minimal important difference from the literature or from a clinical argument, not the difference a pilot happened to show.
  2. 2
    A sourced standard deviation. From a published study in a similar population, with the citation in the protocol.
  3. 3
    The design checked. Repeated measures, clusters or unequal variances change the calculation.
  4. 4
    A sensitivity line. What the sample size becomes if the SD is 20% larger, so the committee sees the risk.
  5. 5
    A justification paragraph written for the protocol, grant or ethics form.
Have the inputs confirmed

A statistician checks the difference and the SD against your sources, reruns the calculation for your exact design and returns the justification paragraph you can paste.

Research Planning & Study Design
Already have a calculation?

Independent Statistical Review confirms a sample size calculation prepared by you, a colleague or an AI tool before it goes to a committee.

Independent Statistical Review

Frequently Asked Questions

The formula uses the normal distribution; the test you will run uses the t distribution, which has heavier tails at small samples. The calculator checks the power of the actual t-test and adds participants until it reaches your target. At samples above about 100 per group the two agree.

Use the SD from a published study with a similar outcome and population, and cite it. If none exists, a pilot of 20 to 30 participants gives a rough value, but plan a sensitivity analysis because a pilot SD is imprecise. Do not guess; the SD enters the formula squared.

No. Paired designs use the SD of the within-person change, which is usually smaller, so this calculator would overestimate the sample. See the pre-post design post for the paired calculation.

If the true difference equals the one you entered, a study of this size would detect it (p below alpha) in 80 of 100 repetitions. It says nothing about a smaller true difference, which would be missed more often.

Yes, when participants can be lost before the outcome is measured. The calculator divides the evaluable n by 1 minus the dropout rate and reports both numbers. Report the evaluable n and the recruited n separately in the protocol.

References

  1. Chow, S. C., Shao, J., Wang, H., & Lokhnygina, Y. (2017). Sample size calculations in clinical research (3rd ed.). Chapman and Hall/CRC.
  2. Cochran, W. G. (1977). Sampling techniques (3rd ed.). Wiley.
  3. Faul, F., Erdfelder, E., Lang, A.-G., & Buchner, A. (2007). G*Power 3: A flexible statistical power analysis program for the social, behavioral, and biomedical sciences. Behavior Research Methods, 39(2), 175-191. https://doi.org/10.3758/BF03193146
  4. Fleiss, J. L., Levin, B., & Paik, M. C. (2003). Statistical methods for rates and proportions (3rd ed.). Wiley.
  5. Hulley, S. B., Cummings, S. R., Browner, W. S., Grady, D. G., & Newman, T. B. (2013). Designing clinical research (4th ed.). Lippincott Williams & Wilkins.
i

Method reviewed by an in-house statistician · Last checked November 2026 · Test cases and boundary cases verified before release

Found an error or have a suggestion? Write to info@onlinespss.com with the calculator name and the inputs you used. Every report is checked by a statistician.

Have a Statistician Confirm the Calculation

Share the study aim, the outcome and the sources for your difference and SD. A statistically trained Research Coordinator reviews the request, and the scope and one fixed project fee are confirmed before work begins.

No Commitment Required

Strictly Confidential

Fixed Project Fee

In-House PhD-Level Statisticians

Same-Day Response