Sensitivity and Specificity Calculator
Calculate sensitivity, specificity, predictive values, and diagnostic accuracy from a confusion matrix.
About sensitivity and specificity
Sensitivity and specificity examples
These confusion matrices illustrate common diagnostic performance patterns.
| Confusion matrix | Key results | Interpretation |
|---|---|---|
| TP 80, FP 10, TN 90, FN 20 | Sensitivity 80%; specificity 90%; accuracy 85% | The test detects four in five affected cases and correctly rejects nine in ten unaffected cases. |
| TP 95, FP 20, TN 180, FN 5 | Sensitivity 95%; specificity 90%; accuracy 91.67% | High sensitivity makes this result pattern useful when missed cases are especially costly. |
| TP 40, FP 5, TN 95, FN 10 | Sensitivity 80%; specificity 95%; accuracy 90% | The low false-positive count produces high specificity and an 88.89% positive predictive value. |
How to calculate diagnostic accuracy
- Count the true-positive, false-positive, true-negative, and false-negative outcomes from one test population.
- Enter each non-negative count in its matching field.
- Select Calculate Metrics to compute sensitivity, specificity, predictive values, and accuracy.
- Interpret the metrics together and consider prevalence, sample size, and the cost of each error.
Sensitivity and specificity FAQ
What is the difference between sensitivity and specificity?
Sensitivity measures the share of actual positive cases that a test detects. Specificity measures the share of actual negative cases that it correctly rejects.
What is a good sensitivity or specificity?
There is no universal cutoff because acceptable performance depends on the use case and the consequences of errors. Screening often prioritizes sensitivity, while confirmation may prioritize specificity.
Why do predictive values change with prevalence?
Predictive values condition on the test result, so the proportion of affected people in the tested population matters. Positive predictive value usually rises as prevalence rises, even if sensitivity and specificity stay fixed.
Can accuracy be misleading?
Yes, especially when one class is much more common than the other. A classifier can have high accuracy while performing poorly on the rare but important class.
Can I enter percentages instead of counts?
No, enter the four observed counts from the confusion matrix. The calculator converts those counts into percentages using the appropriate denominators.