Sensitivity & Specificity Calculator
Full diagnostic-test 2×2 calculator — sensitivity, specificity, PPV, NPV, accuracy and likelihood ratios, plus Bayes-based PPV/NPV recomputation at any disease prevalence.
Sensitivity, specificity & predictive values, step by step
Each metric gets a plain-English definition, the formula this calculator uses, a small diagram of the 2×2 cell it lives in, and a worked example — all in one card so the maths lines up with the visual.
1. Sensitivity — the true-positive rate
Sensitivity is how well the test finds people who really have the disease. Sn = 95% means the test flags 95 of every 100 truly diseased people and misses 5. Screening tests are tuned for high sensitivity so that few real cases slip through.
2. Specificity — the true-negative rate
Specificity is how well the test clears people who truly don't have the disease. Sp = 90% means 90 of every 100 healthy people are correctly cleared and 10 get a false alarm. Confirmatory tests are tuned for high specificity so that few healthy people are wrongly labelled.
3. PPV & NPV — the answer the patient wants
Positive predictive value asks: given a positive test, what's the probability of really having the disease? Negative predictive value asks the mirror question for a negative test. Both depend on how common the disease is in the population — same test, different prevalence, different PPV.
4. Why prevalence changes PPV (Bayes)
Sensitivity and specificity are properties of the test — they don't change when you move to a new population. PPV and NPV do. Apply the same 99% sensitive, 95% specific test in a 10%-prevalence clinic and PPV is 68%; apply it in a 0.1%-prevalence screening pool and PPV drops to under 2%. Bayes' theorem quantifies this.
5. Likelihood ratios — bedside shifts of odds
A likelihood ratio tells you how much a result shifts your belief. Multiply pre-test odds by LR+ after a positive result or LR− after a negative one. Unlike PPV/NPV, LRs don't depend on prevalence — they travel cleanly across populations.
Features of this calculator
- Full diagnostic-test 2×2 input with TP / FP / FN / TN labelling
- All seven metrics side by side: sensitivity, specificity, PPV, NPV, accuracy, LR+ and LR−
- Color-coded contingency table so correct vs incorrect classifications are visually distinct
- PPV / NPV recomputed at ANY hypothetical disease prevalence via Bayes' theorem
- Sample prevalence shown alongside PPV so you always know which population the value applies to
- Show / hide step-by-step working with every formula substituted, including the Bayes-adjusted PPV/NPV
- Zero-cell safe — undefined metrics show '—' rather than crashing
- Copy the full result summary or download the whole panel as an image
Frequently asked questions
+What's the difference between sensitivity and PPV?
Sensitivity conditions on disease status ("given disease, probability of positive test"). PPV conditions on the test result ("given positive test, probability of disease"). Sensitivity is a property of the test; PPV also depends on the population's prevalence.
+Why does PPV change with prevalence but sensitivity does not?
Sensitivity and specificity are conditional on true disease status, so they describe the test itself. PPV and NPV are conditional on the test result, so they depend on how many diseased vs healthy people were in the pool being tested.
+How do I get a PPV for my own patient population?
Enter the study's TP/FP/FN/TN to get sensitivity and specificity, then use the "Recalculate PPV/NPV at a different prevalence" input. The calculator applies Bayes' theorem for you.
+What is a good sensitivity or specificity?
Screening tests aim for very high sensitivity; confirmatory tests aim for very high specificity. There's no universal threshold.
+What if one of my cells is zero?
The affected metric shows '—'. Most commonly TP = 0 makes sensitivity and PPV undefined; TN = 0 makes specificity and NPV undefined.
+Can this handle problems other than disease vs no disease?
Yes — any binary classifier fits: spam vs not, defect vs not, fraud vs legitimate. Just relabel TP/FP/FN/TN.