ScintriaEvidence, funding and
writing for research
ToolsHow it checksLearnPricing
Sign inStart free
Sign in

Free tool · no sign-in

Sample size calculator

For prevalence surveys and two-group comparisons of proportions or means, with power, clustering and dropout. Every step is shown, and you get a justification paragraph ready for your protocol or ethics application. It runs in your browser: nothing you type is sent anywhere.

Checked in public against SciPy, statsmodels and R

One group: a survey to estimate a proportion with a given precision.

%

From earlier studies. Use 50% if unknown: it gives the largest sample.

% points

Half-width of the 95% confidence interval, e.g. 5 for ±5 points.

%

Only if the whole population is small and known, e.g. 1,200 staff.

Adjust for clustering or dropout

Participants per village, clinic or school.

Intra-cluster correlation, e.g. 0.02–0.05.

%

Required sample

385

Formula

n = z² p (1 − p) / d²

Working

  1. 1Critical value. For 95% confidence, z = 1.96.
  2. 2Basic sample size. n₀ = z² × p × (1 − p) / d² = 1.96² × 0.5 × 0.5 / 0.05² = 384.15 → 385.

Justification for your protocol

The sample size was calculated to estimate a proportion with a given precision, using n = z²p(1 − p)/d². Assuming an expected proportion of 50%, an absolute precision of ±5% and 95% confidence (z = 1.96), the minimum sample size is 385. We will therefore recruit 385 participants.

Save it or export to Word and PDF with a free account
These are standard approximation formulas. Check the final figure, and the assumptions behind it, with a statistician before you commit to it in a protocol or grant.

Which calculation do I need?

  • Estimate a prevalence when you survey one group to measure how common something is, for example HIV testing coverage in a district.
  • Compare two proportions when the outcome is yes or no in two groups, for example cure rates with a new treatment and with standard care.
  • Compare two means when the outcome is a measurement, for example blood pressure or haemoglobin.

Worked examples

Each result below comes from this calculator. Enter the same values above to see every step.

A prevalence survey

Expected prevalence unknown (use 50%), precision ±5 percentage points, 95% confidence.

385 respondents

Comparing two proportions

Infection falls from 30% with standard care to 20% with the intervention; two-sided α = 0.05, 80% power, equal groups.

294 per arm, 588 in total

Comparing two means

Blood pressure, standard deviation 15 mmHg, smallest important difference 5 mmHg; two-sided α = 0.05, 80% power.

142 per arm, 284 in total

The same trial in clusters

The two-proportion trial above, run in clinics of about 20 patients with an ICC of 0.05 (design effect 1.95).

574 per arm, 1,148 in total

The formulas

One proportion (survey)
n = z² × p(1 − p) / d²
z for the confidence level (1.96 for 95%), p the expected proportion, d the precision. With a small known population N, apply the finite population correction n / (1 + (n − 1) / N).
Two proportions
n per arm = [z₁₋α/₂ √(2p̄(1 − p̄)) + z₁₋β √(p₁(1 − p₁) + p₂(1 − p₂))]² / (p₁ − p₂)²
p̄ is the average of p₁ and p₂; z₁₋β is 0.84 for 80% power and 1.28 for 90%.
Two means
n per arm = 2σ²(z₁₋α/₂ + z₁₋β)² / Δ²
σ is the standard deviation of the outcome and Δ the smallest difference worth detecting.

The full derivations, with worked examples, are in the free lessons Calculating sample size for means, proportions and events and Clusters, non-inferiority, attrition and writing the section.

What to report in your protocol

  • The primary outcome the calculation is based on.
  • The assumed values (proportions, standard deviation, ICC) and where each comes from, with a reference.
  • The effect size you aim to detect and why it matters clinically.
  • α, power, whether the test is one- or two-sided, and the allocation ratio.
  • Adjustments for clustering and dropout, and the final number to recruit.

Questions

What sample size do I need for a survey with an unknown prevalence?
Use an expected prevalence of 50%, which gives the largest sample. For a 95% confidence interval of ±5 percentage points you need 385 respondents, before any adjustment for non-response or clustering.
What power should I use?
80% is the usual minimum and 90% is common for definitive trials. Higher power needs a larger sample: for the same difference, going from 80% to 90% power increases the sample by about a third.
How do I adjust for dropout?
Divide by the proportion you expect to keep, rather than adding a percentage. With 10% expected dropout, 385 becomes 385 ÷ 0.9 = 428 (rounded up), not 385 + 39 = 424.
How do I adjust for a cluster design?
Multiply by the design effect, 1 + (m − 1) × ICC, where m is the average cluster size and ICC the intra-cluster correlation. With 20 people per cluster and an ICC of 0.05 the design effect is 1.95, so 294 per arm becomes 574 per arm.
Is this calculator accurate?
Scintria's statistics are compared in public against SciPy, statsmodels and R, with the data published so anyone can rerun the comparison. Results are always rounded up to the next whole participant.

Also free: the power calculator and the study design chooser.

Planning the whole study?

Scintria also chooses study designs, writes statistical analysis plans and protocols, analyses your data and drafts full grant proposals, with every source linked. Free to start.

Start free

Related guides

  • How to calculate the sample size for a survey
  • Sample size for comparing two groups
  • Design effect and the ICC
Scintria

Evidence, funding, statistics and writing for researchers, checked in code.

Appearance

Product

  • Funding search
  • Research writer
  • Tools
  • PhD corner
  • Postdoc corner
  • Pricing

Learn

  • Learn
  • Research method guides
  • Getting around Scintria
  • Sample size calculator
  • Power calculator
  • Study design chooser

Trust and legal

  • How Scintria checks its work
  • Validation
  • Sources and coverage
  • Privacy Policy
  • Cookie policy
  • Terms of Use
  • Refund Policy

Contact

  • Sign in
  • Create account
  • About
  • hello@scintria.com
© 2026 ScintriaScintria provides research assistance. It is not medical, statistical, regulatory or legal advice, and it does not decide eligibility for any funder.