Sample Size & Power Calculator
Sample size to compare two means or two proportions at a chosen power, survey sample size for a margin of error with finite-population correction, and the power achieved by an existing n.
The Sample Size Calculator gives the number of subjects per group needed to detect a difference δ between means with standard deviation σ (n = 2[(z_α + z_β)σ/δ]²), between two proportions, or to estimate a proportion within a margin of error (n = z²p(1 − p)/e², with finite-population correction), plus the statistical power for a given n.
Free, runs in your browser. Nothing you enter is uploaded.
How to use it
- Choose the design.
- Enter the effect you want to detect and the variability.
- Set α and power.
- Read n per group; inflate for dropout.
What you enter
- Effect size inputs
- α and power (or confidence and margin)
What you get
- n per group
- Total n
- Standardised effect
- Achieved power
Formula
n = 2 [ (z₁₋α/₂ + z₁₋β) · σ / δ ]² | n = z² p(1−p) / e² | n_fpc = n / (1 + (n − 1)/N)
Larger effects, smaller variability, higher α or lower power all reduce the required n. Power 0.80 and α 0.05 (two-sided) are conventional defaults.
Worked example
Input: δ = 5, σ = 10, α = 0.05 two-sided, power 0.80
Result: n = 63 per group (126 total)
Standardised effect 0.5 (medium) needs about 63 subjects per arm.
Questions
What power should I use?
0.80 is the conventional minimum; 0.90 is common for confirmatory trials. Higher power needs more subjects.
How do I choose the difference to detect?
Use the smallest difference that would matter scientifically or clinically, and the SD from a pilot study or the literature.
How many animals do I need?
Use the compare-means mode with the expected difference and SD from pilot data; ethics committees expect this calculation in the protocol.
Limitations
- Normal-approximation formulas; for small n a t-based calculation gives slightly larger numbers.
- Add 10–20 % for dropout and non-compliance.
References
Related reading
- Sample Size Calculation: Formulas and Practical Considerations
- Statistical Power: What It Is and Why It Matters
- How to Determine the Minimum Number of Animals for Statistical Power
- Choosing the Right Effect Size for Sample Size Calculations
- Using Standard Deviation and Variance in Sample Size Formulas
More Statistics
- Standard Deviation Calculator
- Mean, Median & Mode Calculator
- Variance Calculator
- Z-Score Calculator
- P-Value Calculator
- Confidence Interval Calculator
- T-Test Calculator
- Chi-Square Test Calculator
- Correlation Coefficient Calculator
- Linear Regression Calculator
- Normal Distribution Calculator
- Probability Calculator
All free tools · By Dr. Zubair Khalid, DVM, MS, PhD.