Sensitivity and Specificity Calculator
Calculate sensitivity, specificity, PPV, NPV, likelihood ratios, and accuracy from a 2x2 confusion matrix.
Sensitivity, Specificity, and Predictive Values
This calculator evaluates diagnostic test performance from a 2×2 confusion matrix. It reports sensitivity, specificity, accuracy, likelihood ratios, and prevalence-adjusted PPV and NPV. Related tools: Sensitivity Calculator, Post-Test Probability Calculator, and Relative Risk Calculator.
Core Formulas
$$Sensitivity = \frac{TP}{TP + FN}$$
$$Specificity = \frac{TN}{TN + FP}$$
$$Accuracy = \frac{TP + TN}{TP + TN + FP + FN}$$
$$LR_+ = \frac{Sensitivity}{1 - Specificity}$$
$$LR_- = \frac{1 - Sensitivity}{Specificity}$$
PPV and NPV With Prevalence
Predictive values depend on disease prevalence. The calculator uses prevalence to estimate adjusted positive and negative predictive values, which describe how trustworthy a positive or negative test result is in the target population.
Example
With TP = 48, FN = 12, FP = 18, TN = 122, sensitivity is 80%, specificity is about 87.14%, and accuracy is 85%.
Frequently Asked Questions
What is a confusion matrix?
It is a table of test outcomes: true positives, false positives, false negatives, and true negatives.
Why does prevalence affect PPV and NPV?
When a disease is rare, even a good test can produce many false positives among all positive results. Prevalence shifts the balance of true and false outcomes.
What is a likelihood ratio?
It compares the odds of a test result in diseased people with the odds in healthy people. LR+ applies to positive results; LR- applies to negative results.
Is accuracy enough on its own?
Not always. Accuracy can look high in imbalanced datasets even when sensitivity or specificity is poor.
Can I use this for screening and confirmatory tests?
Yes, as long as you enter the correct TP, FP, FN, and TN counts from the study or validation dataset.