AI Tools Free

Sample Size Calculator for Means

Determine the exact sample size (`n1`, `n2`, and total `N`) required to detect a target mean difference `Δ` or achieve a margin of error `±E` from your standard deviation `σ`, significance level `α`, statistical power `1 − β`, and group allocation ratio `k = n2 / n1`.

Free to useNo sign-upRuns in your browser
Enter your details

Enter the inputs, then select Calculate Sample Size (n).

Choose whether you are powering a two-group comparison, a single-group mean test, or a confidence interval margin of error.

Estimated standard deviation of the continuous outcome variable (must be > 0).

Target mean difference Δ to detect (for hypothesis tests) or half-width margin of error E (for CI mode). Must be > 0.

Type I error rate α and whether the test is two-sided or one-sided.

Probability of detecting a true difference Δ (ignored in Single Mean CI Margin of Error mode).

Ratio of Group 2 size to Group 1 size (1.0 = equal 1:1 split; 2.0 = 2:1 control-to-treatment split).

Your result
Enter your details

Result will appear here

How the Sample Size Calculator for Means Works

Select your study design and enter the standard deviation and target difference to compute both exact normal-approximation values and upward-rounded integer sample sizes.

Two-Sample Normal Approximation: n1 = ((1 + 1/k) × σ² × (Z_{α} + Z_{β})²) / Δ², n2 = k × n1 (each rounded up via ceil); One-Sample Power: n = ceil((σ × (Z_{α} + Z_{β}) / Δ)²); Single-Mean CI: n = ceil((Z_{α} × σ / E)²).

Computes exact normal-approximation sample sizes and always rounds group counts upward to the next integer (Math.ceil) so target power (1 − β) or margin of error (E) is never under-attained.

Sample Size Calculator for Means workflow overview
Workflow overview for Sample Size Calculator for Means.

Sample Size for Means Reference Table (Two-Sided α = 0.05, Equal 1:1 Allocation)

Required sample size per group (`n1 = n2`) and total `N` across common standardized effect sizes (`d = Δ / σ`) and power levels.

Scenario (σ vs. Δ)Standardized Effect (d = Δ / σ)80% Power (n per group / Total N)90% Power (n per group / Total N)Single-Mean 95% CI (n for ±E)
Small Effect (`σ = 15, Δ = 3`)`d = 0.20`**393 / group** (`786` total)**526 / group** (`1,052` total)`97` (`±3` margin)
Default Benchmark (`σ = 15, Δ = 5`)`d = 0.333`**142 / group** (`284` total)**190 / group** (`380` total)`35` (`±5` margin)
Medium Effect (`σ = 15, Δ = 7.5`)`d = 0.50`**63 / group** (`126` total)**85 / group** (`170` total)`16` (`±7.5` margin)
Large Effect (`σ = 15, Δ = 12`)`d = 0.80`**25 / group** (`50` total)**33 / group** (`66` total)`7` (`±12` margin)

How to use Sample Size Calculator for Means step by step

Enter the values for your scenario, verify the units, and run the calculation.

Enter the inputs

Start by entering the required fields in the Sample Size Calculator for Means form above.

Sample Size Calculator for Means step 1: Enter the inputs
Step 1 workflow overview for Sample Size Calculator for Means.

Verify units and assumptions

Match each value to the unit or format shown next to the input box before running the calculation.

Sample Size Calculator for Means step 2: Verify units and assumptions
Step 2 workflow overview for Sample Size Calculator for Means.

Run and export your result

Select Calculate Sample Size (n), inspect the primary metric and breakdown cards, then use Copy result or Download result.txt.

Sample Size Calculator for Means step 3: Run and export your result
Step 3 workflow overview for Sample Size Calculator for Means.

Worked examples for Sample Size Calculator for Means

Compare baseline and alternative runs for Sample Size Calculator for Means before exporting the result.

Baseline example

Calculate sample size for comparing two independent means, testing a single mean, or estimating a mean within a target margin of error. Includes Z-approximation, ceiling rounding, and allocation ratio k = n2/n1.

Sample Size Calculator for Means example 1: Baseline example
Worked example 1 for Sample Size Calculator for Means.

Comparison scenario

Two-Sample Normal Approximation: n1 = ((1 + 1/k) × σ² × (Z_{α} + Z_{β})²) / Δ², n2 = k × n1 (each rounded up via ceil); One-Sample Power: n = ceil((σ × (Z_{α} + Z_{β}) / Δ)²); Single-Mean CI: n = ceil((Z_{α} × σ / E)²).

Sample Size Calculator for Means example 2: Comparison scenario
Worked example 2 for Sample Size Calculator for Means.

Boundary check before exporting

Computes exact normal-approximation sample sizes and always rounds group counts upward to the next integer (Math.ceil) so target power (1 − β) or margin of error (E) is never under-attained.

Sample Size Calculator for Means example 3: Boundary check before exporting
Worked example 3 for Sample Size Calculator for Means.

How to interpret the Sample Size Calculator for Means output

Review the calculated output alongside your entered parameters and unit conventions.

Computes exact normal-approximation sample sizes and always rounds group counts upward to the next integer (Math.ceil) so target power (1 − β) or margin of error (E) is never under-attained.

How to interpret Sample Size Calculator for Means results
Result interpretation guide for Sample Size Calculator for Means.

Pre-Study Sample Size Verification Checklist

Verify these three assumptions before finalizing your sample size.

Two-Sample Normal Approximation: n1 = ((1 + 1/k) × σ² × (Z_{α} + Z_{β})²) / Δ², n2 = k × n1 (each rounded up via ceil); One-Sample Power: n = ceil((σ × (Z_{α} + Z_{β}) / Δ)²); Single-Mean CI: n = ceil((Z_{α} × σ / E)²). Computes exact normal-approximation sample sizes and always rounds group counts upward to the next integer (Math.ceil) so target power (1 − β) or margin of error (E) is never under-attained.

Scope limits and assumptions for Sample Size Calculator for Means
Assumptions and input boundaries for Sample Size Calculator for Means.

Sample Size Calculator for Means: common questions

Answers about using Sample Size Calculator for Means and understanding its results.

Why does the Sample Size Calculator for Means always round up (ceiling) instead of rounding to the nearest integer?

In power analysis and confidence interval planning, a fractional sample size such as n1 = 141.18 means 141 participants would deliver slightly less than the target 80% power (or a slightly wider margin of error than E). Rounding up to the next whole integer (ceil(141.18) = 142 per group, 284 total) guarantees your study meets or exceeds the specified statistical power.

How does the allocation ratio k = n2 / n1 affect total sample size?

An equal 1:1 allocation (k = 1) minimizes the total number of participants required for a given effect size Δ and standard deviation σ. When you use an unequal split—such as k = 2 (twice as many controls as treated subjects)—Group 1 requires fewer subjects (n1 drops by 25%), but the combined total N = n1 + n2 increases by 12.5% because the variance factor (1 + 1/k)(1 + k) is minimized at k = 1.

What is the relationship between SD (σ), target difference (Δ), and Cohen's d in this calculator?

The standardized effect size is Cohen's d = Δ / σ. Because sample size scales with the inverse square of Cohen's d (n ∝ (σ / Δ)² = 1 / d²), cutting your minimum detectable difference Δ in half (or doubling the standard deviation σ) quadruples the required sample size.

When should I add a dropout or attrition buffer to the calculated sample size?

The formula outputs the net analyzable sample size (completers). If your clinical trial, survey, or longitudinal experiment expects an attrition rate r (for example, 15% dropout), divide the calculated integer N by (1 − r): N_enrolled = ceil(N / (1 − 0.15)).

Try your own values

Choose another tool for your next calculation, conversion, or text task.

Calculate Sample Size (n)