Home / Science / Health and medicine / Epidemiology / Diagnostic test calculatorTool #461

Sensitivity, specificity, PPV, NPV and likelihood ratio calculator with Fagan nomogram

Sensitivity, specificity, predictive values, likelihood ratios and accuracy from a 2 × 2 table, with exact or Wilson 95 % intervals. Turn a pre-test probability into a post-test probability and see it on a Fagan nomogram.

Keep it one tap away for everyday use.

Bookmark Diagnostic test calculator?

Press Ctrl + D now. Your browser opens its own bookmark box, where you choose the name and folder.

  1. 2×2 table
  2. Accuracy
  3. Nomogram
Nothing is uploadedWorks offline once open

Your test

For study and teaching, not medical advice. Check with a qualified professional.

Count the people in each box: the test result against the reference standard (the best available way of knowing who really has the condition). Example numbers are made up.

Condition presentCondition absent
Test positive
Test negative

Exact intervals never fall below the true coverage and suit small counts; Wilson intervals are a little narrower and closer to the stated level on average. Ratios use the log method.

What it does

A new test is compared with a reference standard, the best available way of knowing who really has the condition. The results fall into four boxes: true positives, false positives, false negatives and true negatives. This calculator turns those four counts into the numbers every diagnostic accuracy study reports, each with a confidence interval:

  • Sensitivity: of the people who have the condition, the share the test picks up.
  • Specificity: of the people who do not, the share the test correctly clears.
  • Positive and negative predictive values (PPV, NPV): of the people with a positive (or negative) result, the share who really do (or do not) have the condition.
  • Likelihood ratios (LR+ and LR−): how much a positive or negative result changes the odds of the condition.
  • Accuracy, prevalence in the sample, diagnostic odds ratio and Youden’s index.

It then uses Bayes’ theorem to turn a pre-test probability into the post-test probability after a positive or a negative result, and draws the answer on Fagan’s nomogram.

For study and teaching, not medical advice. Check with a qualified professional.

How to use it

  1. Choose 2 × 2 table and type the four counts, or choose Sensitivity and specificity to start from published figures and a prevalence.
  2. Pick the interval method. Exact (Clopper-Pearson) intervals come from the binomial distribution and never cover less than the stated level, so they suit small counts. Wilson score intervals are a little narrower and are close to the stated level on average. Likelihood ratios and the diagnostic odds ratio always use the log method.
  3. Pick the confidence level: 90, 95 or 99 %.
  4. Under Pre-test to post-test probability, type how likely the condition is before testing in your setting. Leave it blank to use the prevalence.
  5. Download the table as CSV, the nomogram as PNG, or a full report as an image, PDF or Word file.

The formulas

With true positives a, false positives b, false negatives c and true negatives d: sensitivity = a/(a + c), specificity = d/(b + d), PPV = a/(a + b), NPV = d/(c + d), accuracy = (a + d)/n. LR+ = sensitivity/(1 − specificity) and LR− = (1 − sensitivity)/specificity, with limits exp(ln LR ± z·SE), where SE(ln LR+) = √(1/a − 1/(a + c) + 1/b − 1/(b + d)) (Simel and colleagues, 1991). The diagnostic odds ratio is ad/bc with Woolf’s log interval. Post-test odds = pre-test odds × LR. On Fagan’s nomogram the pre-test scale sits at −logit(p), the likelihood ratio at ln(LR)/2 and the post-test scale at logit(p), so the three points line up.

Worked example

The made-up example has 84 true positives, 30 false positives, 16 false negatives and 270 true negatives (400 people, 100 with the condition). The page shows sensitivity 84.0 % (exact 95 % interval 75.3 % to 90.6 %), specificity 90.0 % (86.0 % to 93.2 %), PPV 73.7 %, NPV 94.4 %, LR+ 8.4 (5.92 to 11.9) and LR− 0.178. With the sample’s prevalence of 25 % as the pre-test probability, a positive result raises the probability to 73.7 % and a negative result lowers it to 5.6 %.

Switch to Sensitivity and specificity with 90 %, 95 % and a prevalence of 1 %: out of 1000 people, 9 true positives and 49.5 false positives are expected, so the PPV is only 15.4 % even though the test is good.

Tips

  • Sensitivity and specificity belong to the test (in a given population); predictive values change with prevalence. Do not carry a PPV from a hospital study to a screening programme.
  • A likelihood ratio above 10 or below 0.1 changes the probability a lot; one between 0.5 and 2 hardly changes it.
  • Report the intervals. A sensitivity of 100 % from 12 cases has a lower exact limit of 73.5 %.

Frequently asked questions

Which interval should I report? Many journals accept either; the STARD guideline asks only that you say which. Exact intervals are the cautious choice for small studies.

Why is a likelihood ratio shown as ∞ or without an interval? A box with zero makes a ratio 0 or infinite, and its log interval does not exist. Some authors add 0.5 to every box; this tool shows the plain result instead.

Is my data stored? No. Everything is worked out in your browser and nothing is sent anywhere.

Where the numbers come from

  • Formulas: Altman and Bland (1994, BMJ 308:1552 and 309:102) for sensitivity, specificity and predictive values; Clopper and Pearson (1934, Biometrika); Wilson (1927, J Am Stat Assoc); Simel, Samsa and Matchar (1991, J Clin Epidemiol 44:763) for likelihood ratio intervals; Glas et al. (2003, J Clin Epidemiol 56:1129) for the diagnostic odds ratio; Youden (1950, Cancer); Fagan (1975, N Engl J Med 293:257) for the nomogram.
  • Example numbers are made up for teaching.

Standard scientific values, such as constants, atomic weights and melting points, are facts found in every textbook; we name where ours were checked. If you are an author or publisher and want a value, a credit or a table changed or removed, tell us and we will act quickly.

Last updated 2026-11-09.

Related tools

Rates and age standardisation #463 Incidence rates, cumulative incidence and prevalence with confidence intervals, directly age-standardised rates with Fay-Feuer gamma intervals, and indirect standardisation: expected events and the SMR with exact Poisson limits. Paste data by age group or open a file. NNT calculator #465 Number needed to treat or harm from events in a treated and a control group, with the absolute risk reduction, relative risk, relative risk reduction and odds ratio, all with 95 % intervals. Shows the NNT interval the Altman way when it crosses zero. Odds ratio and risk ratio calculator #466 Odds ratio and risk ratio from a 2 × 2 table with Woolf, exact and mid-p intervals, chi-square and Fisher exact tests, or several strata pooled by Mantel-Haenszel with the Breslow-Day test and a forest plot. Case-control or cohort. Method validation statistics #87 Paste replicate results by day, analyst or instrument: mean, SD, RSD and confidence interval, the Grubbs outlier test, bias and recovery against a true value, repeatability and intermediate precision by ANOVA, and the Horwitz ratio. Reliability and agreement #40 Check a questionnaire scale with Cronbach's alpha and item statistics, or rater agreement with Cohen's kappa (weighted too), Fleiss' kappa and all six intraclass correlations with 95 % intervals. Matches R's psych package. Sample size and power calculator #32 How many subjects, samples or survey responses do you need? Sample size for comparing two means, paired data, two proportions, or a survey's margin of error, with power curves. Matches R and G*Power. Uncertainty propagation calculator #25 Type your formula and your measurements with their uncertainties, or paste repeated readings. Get the result with its uncertainty, which input matters most, and a Monte Carlo check.