Diagnostic Test Accuracy Calculator: Sensitivity, Specificity, PPV, NPV and Likelihood Ratios
Compare a new test with a reference (gold) standard. Enter the true and false positives and negatives, and get sensitivity, specificity, predictive values, likelihood ratios and the diagnostic odds ratio, all with confidence intervals. Then move the prevalence slider to see how the positive and negative predictive values change in a different population.
| Disease present (reference +) | Disease absent (reference −) | Total | |
|---|---|---|---|
| Test positive | True positives | False positives | |
| Test negative | False negatives | True negatives | |
| Total |
- PriceFree, no login or sign-up needed
- Your dataProcessed in your browser, never uploaded
- Works onPhone, tablet or computer, any modern browser
- Made byDr. Muhammad Aammar Tufail, Codanics
- Published17 November 2026
- Last updated16 November 2026
📚 How to cite this tool
This tool is free. If it helped your thesis, paper, report or assignment, please cite it. It keeps the tools free and helps other students find them.
Tufail, M. A. (2026). Diagnostic test accuracy calculator: sensitivity, specificity, PPV, NPV and likelihood ratios [Online tool]. Codanics. Retrieved 16 November 2026, from https://codanics.com/tools/diagnostic-test-calculator/
In-text citation: (Tufail, 2026) · Narrative: Tufail (2026)
The access date is today’s date, filled in automatically. Author: Muhammad Aammar Tufail. Published 17 November 2026.
How to use the diagnostic test accuracy calculator
- Run the new (index) test and the reference standard (the best available test, such as culture, biopsy or PCR) on the same people.
- Type the four counts: true positives, false positives, false negatives and true negatives. Or paste raw data with one row per person (test result and reference result) using Paste from Excel or Upload CSV / Excel.
- Choose Wilson or Clopper–Pearson exact confidence intervals and read sensitivity, specificity, predictive values, likelihood ratios and the DOR.
- Move the prevalence slider to see the PPV and NPV in the population where the test will be used, and what happens to 1,000 people tested.
- If you only have published sensitivity and specificity, use the second tab to get post-test probabilities. Copy the table, download the chart or copy the results sentence.
What each measure tells you
Sensitivity and specificity describe the test itself and do not, in theory, depend on how common the disease is. A highly sensitive test rarely misses disease, so a negative result helps to rule it out (“SnNout”). A highly specific test rarely raises false alarms, so a positive result helps to rule it in (“SpPin”).
Predictive values answer the patient’s question: “I tested positive. How likely is it that I have the disease?” They depend strongly on prevalence. A test with 95% sensitivity and 95% specificity has a PPV of 95% when half the people tested are ill, but only 16% when 1% are ill, because most positives are then false positives. That is why the PPV and NPV from a study sample apply only to populations with a similar prevalence, and why this tool has a prevalence slider.
Likelihood ratios combine sensitivity and specificity and can be applied to any pre-test probability. As a rough guide, LR+ above 10 or LR− below 0.1 give large, often conclusive, changes in probability; LR+ of 5–10 or LR− of 0.1–0.2 give moderate changes; and values close to 1 hardly change anything.
Confidence intervals
Sensitivity, specificity, predictive values, accuracy and prevalence are proportions. The default Wilson score interval performs well even when a proportion is close to 0% or 100%. The Clopper–Pearson exact interval is more conservative and is often requested by journals. Likelihood ratios use the log method of Simel et al. (1991), and the DOR uses the Woolf log method. Predictive values at a prevalence you choose use the same likelihood-ratio limits, which is the logit method recommended by Mercaldo et al. (2007).
epiR::epi.tests().References: Altman DG, Bland JM (1994) BMJ 308:1552 and 309:102 · Simel DL, Samsa GP, Matchar DB (1991) J Clin Epidemiol 44:763–770 · Mercaldo ND, Lau KF, Zhou XH (2007) Stat Med 26:2170–2183 · Bossuyt PM et al. (2015) STARD 2015, BMJ 351:h5527.
Frequently asked questions
How do I calculate sensitivity and specificity?
Sensitivity = true positives ÷ (true positives + false negatives), the share of people with the disease who test positive. Specificity = true negatives ÷ (true negatives + false positives), the share of healthy people who test negative.
What is the difference between sensitivity and PPV?
Sensitivity starts from people who have the disease and asks how many test positive. PPV starts from people who test positive and asks how many have the disease. PPV depends on prevalence; sensitivity largely does not.
Why is my PPV so low even though the test is accurate?
When a disease is rare, even a small false-positive rate produces more false positives than true positives. Screening tests in the general population therefore often have a low PPV, and positives are confirmed with a second test.
What is a good likelihood ratio?
LR+ above 10 and LR− below 0.1 are considered strong evidence to rule a diagnosis in or out. Values between 2 and 5 (or 0.2 and 0.5) change the probability only a little.
Should I use Wilson or exact (Clopper–Pearson) confidence intervals?
Both are acceptable. Wilson intervals are closer to the nominal coverage and are narrower; Clopper–Pearson intervals are guaranteed to cover at least 95% and are more conservative. Say which one you used in your methods.
Can I use this for a meta-analysis of diagnostic studies?
It summarises one study at a time. To pool sensitivity and specificity across studies you need a bivariate random-effects model (for example the R package mada), but this tool is handy for extracting each study’s values and CIs.
Do I need to log in or create an account to use the diagnostic test accuracy calculator?
No. There is no login, no sign-up and no email required. Open the page and start using it straight away, for free, on any device.
How do I cite this tool in my thesis or paper?
Use the citation box on this page. In APA 7th edition: Tufail, M. A. (2026). Diagnostic test accuracy calculator: sensitivity, specificity, PPV, NPV and likelihood ratios [Online tool]. Codanics. Retrieved [date you used it], from https://codanics.com/tools/diagnostic-test-calculator/. BibTeX, RIS (EndNote, Mendeley, Zotero), MLA, Harvard, Chicago and Vancouver formats are also available.
Free guides and courses from Codanics
More free tools
See all free Codanics tools → · Codanics on YouTube · WhatsApp channel

