Free calculatorLive resultsSteps and sourcesEmbed on your site, free

Determine Sample Size Calculator

Sample Size Calculator works out Recommended sample size and Unrounded requirement from Study design, What to calculate and Basis. The default figures on this page give recommended sample size of 385; change any entry and the result, the working and the sources update together.

Recommended sample size
385
Sample Size Calculator
Unrounded requirement
384.145882
Total across all groups
385
Recruit this many to allow for attrition
385
Margin of error
5 %
z for the confidence level
1.959964
z for the power
0.841621
Significance level (alpha)
0.05
Formula used
n = z^2 p(1-p) / e^2
Worked out from Cochran, W.G. (1977), Sampling Techniques, 3rd edition, Wiley, chapters 4 and 5 and 8 other sources.
Sample-size calculations for clinical, regulatory or published research should be confirmed by a qualified statistician against the actual analysis plan before a study is registered or a protocol is finalised.

Your figures

Updates as you type
Applies to the one-proportion and one-mean designs. Comparative designs are always power-based.
50% is the most conservative choice for a survey because p(1-p) is largest there.
Half-width of the confidence interval, in percentage points.
The smallest difference in means that the study should be able to detect.
Used to turn a required number of events into a number of participants, and as the outcome rate for the events-per-variable rule.
Leave at 0 for a very large or unknown population (no finite-population correction).
Used by the margin-of-error, power, design-effect and finite-population-correction modes.

How this is worked out

3 steps
  1. alpha = 1 - 95/100 = 0.05, two-sided, so z(alpha) = 1.959963985.
  2. z(beta) for 80% power = 0.841621234.
  3. n = z^2 p(1-p) / e^2 = 3.841458821 x 0.25 / 0.0025 = 384.145882

Its 5 worked examples are re-run on every release, last on 15 September 2026. What changed

Sources and references

9 sources
Cochran, W.G. (1977), Sampling Techniques, 3rd edition, Wiley, chapters 4 and 5
n = z^2 p(1-p)/e^2 and the finite-population correction n N /(N + n - 1).
Raosoft Inc., Sample Size Calculator - stated formula
x = z^2 r(100-r); n = N x /((N-1)E^2 + x) - algebraically identical to the corrected Cochran form used here.
Fleiss, J.L., Levin, B. & Paik, M.C. (2003), Statistical Methods for Rates and Proportions, 3rd edition, Wiley, chapter 4
Two-proportion sample size in the uncorrected normal-approximation form.
Chow, S.-C., Shao, J. & Wang, H. (2008), Sample Size Calculations in Clinical Research, 2nd edition, Chapman & Hall
Two-mean, paired, noninferiority and equivalence formulas.
Schoenfeld, D.A. (1983), "Sample-size formula for the proportional-hazards regression model", Biometrics 39(2), 499-503
Required number of events d = (z_alpha + z_beta)^2 / (ln HR)^2 p1 p2.
Buderer, N.M.F. (1996), "Statistical methodology: incorporating the prevalence of disease into the sample size calculation for sensitivity and specificity", Academic Emergency Medicine 3(9), 895-900
Kish, L. (1965), Survey Sampling, Wiley
The design effect DEFF = 1 + (m - 1) ICC for equal-sized clusters.
Peduzzi, P. et al. (1996), "A simulation study of the number of events per variable in logistic regression analysis", Journal of Clinical Epidemiology 49(12), 1373-1379
The 10-events-per-variable rule of thumb.
Hinkle, D.E., Wiersma, W. & Jurs, S.G. (2003), Applied Statistics for the Behavioral Sciences, 5th edition
Fisher z sample size for a correlation: n = ((z_alpha + z_beta)/arctanh r)^2 + 3.

What the Sample Size Calculator calculates

Computes the sample size needed for a survey proportion, a mean, a comparison of two proportions or two means, a paired study, a correlation, a noninferiority or equivalence trial, a log-rank survival study, a diagnostic-accuracy study or a cluster-randomised trial, and works backwards to the margin of error or the power of a sample you already have.

How to use this Sample Size Calculator

Enter Study design, What to calculate, Basis and Confidence level. Recommended sample size updates as you type, and “Use a worked example” loads checked figures you can adjust. Change one figure at a time to see what drives the result.

How the result is worked out

Open “How this is worked out” beside the result for the step-by-step calculation behind Recommended sample size, Unrounded requirement and Per group (group 1).

The method follows Cochran, W.G. (1977), Sampling Techniques, 3rd edition, Wiley, chapters 4 and 5, Raosoft Inc., Sample Size Calculator - stated formula, Fleiss, J.L., Levin, B. & Paik, M.C. (2003), Statistical Methods for Rates and Proportions, 3rd edition, Wiley, chapter 4, Chow, S.-C., Shao, J. & Wang, H. (2008), Sample Size Calculations in Clinical Research, 2nd edition, Chapman & Hall and Schoenfeld, D.A. (1983), "Sample-size formula for the proportional-hazards regression model", Biometrics 39(2), 499-503.

The classic survey: 95% confidence, +/-5%, unknown population example

With Study design: one-proportion, Confidence level: 95, Margin of error: 5, Expected proportion (group 1): 50, the calculator returns Recommended sample size: 385, Unrounded requirement: 384.145882, z for the confidence level: 1.95996398. This example is checked against an independent source in the test suite.

What you can compare

Change one input at a time to see how it affects Recommended sample size, Unrounded requirement and Per group (group 1). The inputs you can vary are Study design, What to calculate, Basis, Confidence level, Statistical power and Test sidedness.

Understanding Recommended sample size, Unrounded requirement and Per group (group 1)

Sample-size calculations for clinical, regulatory or published research should be confirmed by a qualified statistician against the actual analysis plan before a study is registered or a protocol is finalised.

Results are general information, not financial, tax, legal, medical or engineering advice. Check any decision that matters with a qualified professional.

Embed this calculator on your website

Copy this code into any page. The calculator appears with the figures currently entered, sizes itself to fit, and a small credit line links back here. Free, no account, no ads inside it, no tracking of your readers. Set your own figures and fixed fields; Personal removes the credit line, sets your colour and shows you which sites use it.

Preview

See something wrong? Report a problem with this calculator

Frequently asked questions

How do I calculate my sample size?

Computes the sample size needed for a survey proportion, a mean, a comparison of two proportions or two means, a paired study, a correlation, a noninferiority or equivalence trial, a log-rank survival study. Open “How this is worked out” beside the result to see each step for your own figures.

Is there an app that can calculate sample size?

It needs Study design, What to calculate, Basis, Confidence level, Statistical power and Test sidedness. Nothing else is required, and the figures stay in your browser.

What is the 30 sample size rule?

On the figures this page opens with — confidence level 95%, expected proportion (group 1) 50%, margin of error 5% and population size 0 — the recommended sample size is 385. No single number fits everyone: change any figure above and the answer updates as you type, with each step of the arithmetic beside it.

Who calculator for sample size?

Computes the sample size needed for a survey proportion, a mean, a comparison of two proportions or two means, a paired study, a correlation, a noninferiority or equivalence trial, a log-rank survival study. On the figures this page opens with — confidence level 95%, expected proportion (group 1) 50% and margin of error 5% — the recommended sample size is 385. Put your own figures in their place and the working updates beside the result.

What information do I need for the Sample Size Calculator?

You need Study design, What to calculate, Basis, Confidence level, Statistical power, Test sidedness, Expected proportion (group 1) and Expected proportion (group 2). The page opens with default figures that give recommended sample size of 385, so you can see the scale before entering your own.

What does this Sample Size Calculator show?

It shows Recommended sample size, Unrounded requirement, Per group (group 1), Per group (group 2), Total across all groups, Recruit this many to allow for attrition, Required number of events and Design effect (DEFF), with the working and any warnings for your entries.

Related calculators

View all related calculators9 more