ToolsConductScience tool
3 Input ModesFree in-browser calculator

Diagnostic Test Calculator.

Compute sensitivity, specificity, PPV, NPV, likelihood ratios, DOR, and Shannon entropy from a 2×2 table. Wilson or Clopper-Pearson CIs. Data never leaves your browser.

PrivateData stays in your browser
LiveNo sign-up required
Open methodFormula shown on this page
CitableMethods and citation included

Calculator

Results update in place

Try it out

Load example Diagnostic Test data to see the full workflow

Enter the four cells of the 2×2 contingency table.

Disease +
Disease −
Test +
Test −
CI Method:

When to use

  • Evaluate diagnostic test accuracy from a 2×2 contingency table (TP, FP, FN, TN)
  • Compute sensitivity, specificity, PPV, NPV, and likelihood ratios with confidence intervals
  • Quantify diagnostic information gain using Shannon entropy
  • Generate a manuscript-ready methods paragraph for a diagnostic accuracy study
  • Back-calculate a 2×2 table from known sensitivity, specificity, and prevalence

Do not use for

  • Continuous-score tests without a fixed threshold — use the ROC/AUC Calculator instead
  • Comparing two measurement methods for agreement — use the Method Comparison Analyzer
  • Sample size planning for a diagnostic study — use the Diagnostic Sample Size Calculator

PPV and NPV depend on prevalence

Sensitivity and specificity are stable properties of the test, but PPV and NPV shift dramatically with disease prevalence. A test with 95% sensitivity and 95% specificity has a PPV of only 16% at 1% prevalence. Always report the prevalence alongside PPV/NPV.

Wilson CIs are preferred over Wald CIs

Wilson score intervals have better coverage properties and are never degenerate (e.g., [0, 0] when the proportion is 0). Use Clopper-Pearson exact CIs only when strict coverage guarantees are required, such as regulatory submissions.

Zero cells require correction

When any cell of the 2×2 table is zero, likelihood ratios and DOR become undefined. The Haldane-Anscombe correction (adding 0.5 to all cells) produces finite estimates with valid CIs. This is standard in meta-analysis.

Likelihood ratios are more portable than PPV/NPV

LR+ and LR− are independent of prevalence, making them transferable across clinical settings. An LR+ > 10 or LR− < 0.1 provides strong diagnostic evidence regardless of the population.

1

Method

Diagnostic accuracy metrics are computed from a 2×2 contingency table (TP, FP, FN, TN). Sensitivity, specificity, PPV, and NPV use standard proportion formulas with Wilson score or Clopper-Pearson exact confidence intervals. Likelihood ratios and DOR use log-scale CIs. Shannon entropy information gain is computed as the reduction in binary entropy from pretest to expected post-test uncertainty. The Haldane-Anscombe correction (adding 0.5 to all cells) is applied when any cell is zero. All calculations run client-side in the browser.

2

Published

Published 2026-04-05. Calculations support planning and documentation; verify procurement decisions against manufacturer specifications or institutional SOPs.

3

How to cite

How to Cite

ConductScience Diagnostic Test Calculator. ConductScience, Inc. 2026. Available at: https://conductscience.com/tools/diagnostic-test-calculator

Wilson EB. Probable inference, the law of succession, and statistical inference. J Am Stat Assoc. 1927;22(158):209-212. doi:10.1080/01621459.1927.10502953

Diagnostic Accuracy Fundamentals

Diagnostic test evaluation centers on the 2×2 table — the cross-classification of a reference standard (gold standard) and the index test. From this table, we compute:

• Sensitivity = TP / (TP + FN) — detection rate among the diseased • Specificity = TN / (FP + TN) — exclusion rate among the non-diseased • PPV = TP / (TP + FP) — precision of a positive result • NPV = TN / (FN + TN) — precision of a negative result • LR+ = Sens / (1 − Spec) — how much a positive test increases disease odds • LR− = (1 − Sens) / Spec — how much a negative test decreases disease odds

Sensitivity and specificity are properties of the test (stable across populations). PPV and NPV depend on prevalence — the same test can have a PPV of 95% at 50% prevalence and 30% at 2% prevalence.

Information Theory in Diagnostics

Shannon entropy provides a principled measure of diagnostic uncertainty. For a binary outcome with probability p:

H(p) = −p · log₂(p) − (1−p) · log₂(1−p)

Maximum uncertainty (1 bit) occurs at p = 0.5. The information gain from a test is:

IG = H(pretest) − E[H(posttest)]

where E[H(posttest)] = P(T+) · H(posttest|T+) + P(T−) · H(posttest|T−). A test with high information gain dramatically reduces uncertainty regardless of the result. This metric is more nuanced than accuracy — a test can have high accuracy in low-prevalence settings while providing almost zero information.

Frequently asked

325
Free tools
1,200+
Institutions
100%
Client-side
0
Uploads required