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.
Free sandbox · No credit card · 21 CFR Part 11 compliant
Cases needed
139
Non-cases needed
196
Enrol (10% non-evaluable)
773
695
245
Sample size for diagnostic accuracy in brief
Free tool
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.
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.
| Half-width | Cases | Non-cases | Evaluable N |
|---|---|---|---|
| ±3 pts | 385 | 545 | 1,925 |
| ±5 pts | 139 | 196 | 695 |
| ±7.5 pts | 62 | 88 | 310 |
| ±10 pts | 35 | 49 | 175 |
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
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
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
95% confidence; totals rounded up; enrol includes the stated non-evaluable allowance.
| Scenario | Cases needed | Non-cases needed | Total by Se / by Sp | Enrol |
|---|---|---|---|---|
| Se 90%, Sp 85%, ±5 points, prevalence 20%, 10% non-evaluable | 139 | 196 | 695 / 245 | 773 |
| Se 90%, Sp 85%, ±5 points, prevalence 50%, no dropout | 139 | 196 | 278 / 392 | 392 (specificity binds) |
| Se 80%, Sp 90%, ±7.5 points, prevalence 10%, 10% non-evaluable | 110 | 62 | 1,100 / 69 | 1,223 |
| Se 95%, Sp 90%, ±5 points, screening prevalence 5%, 10% non-evaluable | 73 | 139 | 1,460 / 147 | 1,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
| Half-width | Cases | Non-cases | Evaluable total (consecutive) |
|---|---|---|---|
| ±3 points | 385 | 545 | 1,925 |
| ±5 points | 139 | 196 | 695 |
| ±7.5 points | 62 | 88 | 310 |
| ±10 points | 35 | 49 | 175 |
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.
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.
Design considerations
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
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.

For the protocol
Define both, plus who reads the reference standard and whether they are blind to the index test.
Cite the pilot or literature, and give the number of participants behind each.
State it for the recruiting setting, not the general population.
Half-width, confidence level and the interval method used in the analysis.
Say how they are counted and the allowance for non-evaluable tests.
Consecutive, random or sampled by disease status, with the consequence for prevalence and predictive values.
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.
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.
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².
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.
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.
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.
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.
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.
Keep exploring
EDC for diagnostic accuracy studies
Data capture for index test and reference standard.
Sample size calculator for clinical trials
The general calculator.
Non-inferiority sample size calculator
Comparing against a margin.
Dropout-adjusted sample size calculator
From evaluable to enrolled.
Minimum detectable effect calculator
What a fixed n can detect.
Sample size calculation
Glossary definition.
Build the eCRFs, visit schedule and randomization in the free sandbox with nearly every feature. No credit card, pay only at go-live.