Free tool · Diagnostic studies · Precision-basedUpdated November 1, 2026

Diagnostic accuracy sample size calculator: cases, non-cases and total N for sensitivity and specificity

Enter the sensitivity and specificity you expect, the precision you want (the half-width of the confidence interval), the disease prevalence in your study population and a dropout allowance. The tool returns the cases and non-cases needed, the total to enrol, and what happens at other levels of precision.

  • Buderer (1996) formulas
  • Consecutive or sampled-by-status designs
  • Non-evaluable allowance

Free sandbox · No credit card · 21 CFR Part 11 compliant

  • ISO 27001 certified
  • 21 CFR Part 11 compliant
  • GDPR compliant
  • EU and US data hosting
  • HIPAA compliant
  • ICH GCP E6(R3) compliant
Demo: Se 90%, Sp 85%, ±5 points, prevalence 20%, 95% confidence

Cases needed

139

Non-cases needed

196

Enrol (10% non-evaluable)

773

Total driven by sensitivity (cases ÷ prevalence)695/800

695

Total driven by specificity (non-cases ÷ (1 − prevalence))245/800

245

Demo data. Sensitivity needs the larger total because only 20% of participants have the disease.

Sample size for diagnostic accuracy in brief

  • A diagnostic accuracy study needs two sample sizes. Sensitivity is estimated only from people with the disease, specificity only from people without it. Each needs its own count.
  • Prevalence turns those counts into a total. If 20% of your participants have the disease, 139 cases need about 695 participants. The larger of the two totals (from sensitivity and from specificity) decides how many to recruit.
  • The Buderer formula targets precision, not power. It gives the number needed so that the confidence interval around an expected sensitivity or specificity is no wider than ± d: n = z² p (1 − p) / d².
  • Sampling by disease status avoids the prevalence problem but means prevalence and predictive values cannot be estimated from the sample.
  • Allow for results you cannot use. Indeterminate tests, missing reference standards and withdrawals reduce the evaluable number; divide by one minus that proportion.

Free tool

Calculate cases, non-cases and total N

The defaults describe a test with expected sensitivity 90% and specificity 85%, a target precision of ±5 percentage points at 95% confidence, a disease prevalence of 20% and 10% non-evaluable results. Edit any value or switch to a design sampled by disease status.

Sampling
%
%
points
%
%
Enrol
773
695 evaluable
Cases needed
139
with the disease
Non-cases needed
196
without it

Sensitivity needs 139 cases, which at 20% prevalence means 695 participants. Specificity needs 196 non-cases, or 245 participants. The larger figure, 695, drives the study (sensitivity is the binding measure), and allowing for 10% non-evaluable results gives 773 to enrol. At that size you expect about 139 cases and 556 non-cases.

Sample size at other precision targets
Half-widthCasesNon-casesEvaluable N
±3 pts3855451,925
±5 pts139196695
±7.5 pts6288310
±10 pts3549175

Planning aid, not validated software; runs in your browser and stores nothing. Buderer (1996) normal-approximation formula for the precision of sensitivity and specificity: n = z² · p(1 − p) / d². It targets the confidence interval width of each measure, not the power of a hypothesis test; for a comparison against a performance goal or another test, use a power-based method. Expected values should come from pilot data or the literature, and the statistician confirms the interval method.

The logic

Why sensitivity and specificity need separate counts

Sensitivity is the proportion of people with the target condition that the index test calls positive. Specificity is the proportion of people without it that the test calls negative. They are estimated from different groups: the first only from participants whose reference standard shows disease, the second only from the others. A study with 600 participants of whom 30 have the disease estimates specificity very precisely and sensitivity hardly at all, since an interval for a proportion based on 30 people is wide.

That is why the sample size is built in two steps. First, find the number of cases needed for the desired precision of sensitivity, and the number of non-cases needed for specificity. Second, convert each to a total number of participants by dividing by the proportion of the study population expected to be a case (prevalence) or a non-case (1 − prevalence). Whichever total is larger decides recruitment, and the other measure ends up more precise than planned.

The ingredients are all assumptions. The expected sensitivity and specificity come from pilot data, the literature or the performance the test is intended to achieve; the precision (the half-width d of the 95% interval) is a judgement about what is useful to a reader, for instance a lower confidence limit that stays above a clinically acceptable level; and the prevalence is the proportion of the study population with the condition, which may be very different from that in the general population. A study in a referral clinic can easily have 30% prevalence while screening has 1 to 2%. Planning with the wrong prevalence is the commonest reason a diagnostic accuracy study ends up with too few cases.

Method

The Buderer formula and a worked example

Buderer (1996) gives the number of participants with the condition needed for the sensitivity estimate to have an absolute half-width d at confidence level 1 − α: n_cases = z² × Se × (1 − Se) / d², where z is the normal quantile (1.96 for 95%). The total number of participants is n_cases / prevalence. For specificity the same formula applies with Sp, and the total is n_non-cases / (1 − prevalence). It is the normal-approximation sample size for a single proportion, applied twice.

Worked example. Expected sensitivity 90%, specificity 85%, half-width 5 percentage points, 95% confidence, prevalence 20%. Cases: 1.96² × 0.90 × 0.10 / 0.05² = 138.3, so 139 cases. Non-cases: 1.96² × 0.85 × 0.15 / 0.05² = 195.9, so 196 non-cases. At 20% prevalence, 139 cases need 139 / 0.20 = 695 participants, while 196 non-cases need 196 / 0.80 = 245. The total is the larger, 695, and sensitivity is the binding measure. With 10% of results non-evaluable, enrol 695 / 0.90 = 772.2, which rounds up to 773. At that size you would expect about 155 cases and 618 non-cases, so specificity will be much more precise than ± 5 points.

In a study that samples by disease status (for example, known cases from a registry and matched controls), prevalence does not enter. You need 139 cases and 196 non-cases, and with 10% non-evaluable, 155 and 218, 373 participants in total. That is fewer than 773 because you control the case mix, but the sample cannot give you prevalence, and predictive values then need an outside prevalence. Case-control sampling in diagnostic accuracy studies is also more prone to spectrum bias, since known cases tend to be more severe than the cases a clinician meets, and a reviewer will ask about it.

The formula assumes the normal approximation, so it is unreliable when expected sensitivity or specificity is near 100% or the half-width runs past a limit (an interval above 100% is impossible). The tool warns when the interval would cross 0 or 100%. In those cases use an exact (Clopper-Pearson) or Wilson interval planning method, or a power-based approach with a pre-specified performance goal, which this tool does not provide.

Worked examples

Four scenarios compared

95% confidence; totals rounded up; enrol includes the stated non-evaluable allowance.

ScenarioCases neededNon-cases neededTotal by Se / by SpEnrol
Se 90%, Sp 85%, ±5 points, prevalence 20%, 10% non-evaluable139196695 / 245773
Se 90%, Sp 85%, ±5 points, prevalence 50%, no dropout139196278 / 392392 (specificity binds)
Se 80%, Sp 90%, ±7.5 points, prevalence 10%, 10% non-evaluable110621,100 / 691,223
Se 95%, Sp 90%, ±5 points, screening prevalence 5%, 10% non-evaluable731391,460 / 1471,623

The rows show how strongly prevalence drives the total. The same test with 50% prevalence needs 392 participants; with 20% it needs 695; at a screening prevalence of 2%, 139 cases alone would mean about 6,950 participants, which is why screening accuracy studies often enrich cases or use a different design.

Precision trade-off

How the sample size changes with the half-width (Se 90%, Sp 85%, prevalence 20%)

Half-widthCasesNon-casesEvaluable total (consecutive)
±3 points3855451,925
±5 points139196695
±7.5 points6288310
±10 points3549175

Halving the half-width multiplies the sample size by about four. Confidence level matters too: at ±5 points and 99% confidence the same test needs 239 cases and 339 non-cases; at 90% confidence, 98 and 138.

Plan the study data from index test to reference standard

Build the index test and reference standard forms in the free sandbox, add edit checks, and test the whole data flow with sample participants. Pay only at go-live.

Plan a diagnostic study free

Design considerations

What the number does not cover

The sample size is the start of the design, not the whole of it. The questions that decide whether the accuracy estimates mean anything are about method. Is the reference standard applied to everyone, whatever the index test result, or only to those who test positive (verification bias)? Is the reference standard read blind to the index test, and the index test read blind to the reference standard? Do the participants resemble the people in whom the test will be used (spectrum)? What happens to indeterminate or invalid results: are they counted as errors, excluded or reported separately? The STARD reporting guideline for diagnostic accuracy studies is the usual checklist for these items, and it is worth designing to it from the start.

The number also does not cover comparisons. If the aim is to show that a new test is not worse than a comparator, or that it beats a performance goal such as sensitivity above 80%, the sample size needs a hypothesis test with a margin, as in the non-inferiority sample size calculator, and a paired design for two tests applied to the same people. For the more general rules, the sample size calculator for clinical trials and the glossary entry on sample size calculation describe the inputs a protocol states.

Finally, the figures here are for the evaluable analysis set. Add the loss you expect from the sources above to get the number to recruit, and remember that missing reference standard results are rarely random. The dropout-adjusted sample size calculator explains the division rule used here.

In Capture

Collecting index test and reference standard data

Capture does not calculate diagnostic accuracy statistics; it collects the data they come from. The EDC for diagnostic accuracy studies page covers the study set-up in detail.

  • eCRFs for the index test result and the reference standard, built in the form builder with edit checks and auto-queries.
  • Skip logic for indeterminate or missing results, and visit windows that flag a reference standard done too long after the index test.
  • A field-level audit trail with old value, new value, user, time and reason for every change.
  • CSV or Excel exports with a data dictionary, ready for the accuracy analysis.
EDC for diagnostic accuracy studies
app.capture.study · Casebook
Capture eCRF data entry with per-field query, verification, freeze and lock controls

For the protocol

What to write next to the sample size

Target condition and reference standard

Define both, plus who reads the reference standard and whether they are blind to the index test.

Expected Se and Sp with sources

Cite the pilot or literature, and give the number of participants behind each.

Prevalence in the study population

State it for the recruiting setting, not the general population.

Precision target

Half-width, confidence level and the interval method used in the analysis.

Evaluable set and handling of indeterminate results

Say how they are counted and the allowance for non-evaluable tests.

Sampling scheme

Consecutive, random or sampled by disease status, with the consequence for prevalence and predictive values.

FAQ

Questions teams ask before they switch

Something not covered here? Ask us directly.

How do you calculate sample size for sensitivity and specificity?

Use the Buderer formula separately for each: n = z² p (1 − p) / d², where p is the expected sensitivity or specificity and d the desired half-width of the confidence interval. The result is the number of cases for sensitivity and non-cases for specificity. Divide by the prevalence (for cases) or one minus the prevalence (for non-cases) to get the total participants, and take the larger total.

Why is my total so large when prevalence is low?

Sensitivity can only be estimated from cases. If 5% of participants have the disease and you need 73 cases, you need about 1,460 participants. Options are to enrich the sample with cases (accepting spectrum bias and no prevalence estimate), to accept a wider interval, or to recruit from a higher-prevalence setting if it is representative.

What half-width should I choose?

Choose it from what a reader needs: a ±5 point interval around 90% means a lower limit near 85%. A common aim is a lower limit that stays above a clinically acceptable level. Narrower intervals are costly because the sample size scales with 1/d².

Does this give power for a hypothesis test?

No. It sizes the study so a confidence interval has a given width. If you want to test whether sensitivity exceeds a performance goal, or compare two tests, use a power-based method with a margin.

What if sensitivity is close to 100%?

The normal approximation breaks down near 0% or 100%. The tool warns when the interval would pass those limits. Use an exact or Wilson interval based method, which a statistician can run, and expect somewhat different numbers.

Can I use this with a case-control design?

Yes: switch to “Sampled by disease status”. The tool then returns cases and non-cases separately, with no prevalence term. The study cannot estimate prevalence or predictive values on its own, and may overstate accuracy because of spectrum bias.

Where does STARD fit?

STARD is the reporting guideline for diagnostic accuracy studies. It does not set sample sizes, but it expects the paper to explain how the sample size was determined and to describe participants, the reference standard and indeterminate results. Planning to the checklist from the protocol stage is easier than adding the items at the end.

Is anything stored or sent?

No. The calculation runs in your browser and nothing is saved or transmitted. It is a planning aid, not validated software, and a statistician should confirm the final sample size.

Plan the sample, then build the data capture

Build the eCRFs, visit schedule and randomization in the free sandbox with nearly every feature. No credit card, pay only at go-live.

Plan a diagnostic study free