What This Calculator Does
This tool measures the performance of a binary diagnostic test or classification model. From the four cells of a 2×2 confusion matrix — True Positives (TP), False Negatives (FN), True Negatives (TN), and False Positives (FP) — it computes sensitivity, specificity, positive and negative predictive values (PPV/NPV), and overall accuracy. These metrics are widely used in medicine, epidemiology, and machine learning.
How to Use It
Enter the count of each outcome from your study or model. A "positive" usually means the condition is present (or the model predicts the positive class). TP and FP are cases the test called positive; TN and FN are cases the test called negative. Click calculate to see all five metrics as percentages.
The Formulas Explained
Sensitivity = TP / (TP + FN) tells you how well the test catches true cases — a high value means few sick patients are missed. Specificity = TN / (TN + FP) tells you how well it rules out healthy people — a high value means few false alarms. PPV = TP / (TP + FP) is the chance a positive result is real, and NPV = TN / (TN + FN) is the chance a negative result is truly negative. Accuracy = (TP + TN) / total summarizes overall correctness.
$$\text{Sensitivity} = \frac{\text{TP}}{\text{TP} + \text{FN}} \times 100\%$$
$$\text{Specificity} = \frac{\text{TN}}{\text{TN} + \text{FP}} \times 100\%$$
$$\text{PPV} = \frac{\text{TP}}{\text{TP} + \text{FP}} \times 100\%$$
$$\text{NPV} = \frac{\text{TN}}{\text{TN} + \text{FN}} \times 100\%$$
$$\text{Accuracy} = \frac{\text{TP} + \text{TN}}{\text{TP} + \text{FN} + \text{TN} + \text{FP}} \times 100\%$$
Worked Example
Suppose a test gives TP = 90, FN = 10, TN = 80, FP = 20.
$$\text{Sensitivity} = \frac{90}{90 + 10} = 90\%$$
$$\text{Specificity} = \frac{80}{80 + 20} = 80\%$$
$$\text{PPV} = \frac{90}{90 + 20} \approx 81.82\%$$
$$\text{NPV} = \frac{80}{80 + 10} \approx 88.89\%$$
$$\text{Accuracy} = \frac{90 + 80}{200} = 85\%$$
FAQ
What is the difference between sensitivity and specificity? Sensitivity measures how well a test detects people who have the condition; specificity measures how well it correctly clears people who do not.
Why do PPV and NPV differ from sensitivity/specificity? Predictive values depend on disease prevalence in your sample, while sensitivity and specificity are intrinsic test properties.
Can a test be 100% sensitive but useless? Yes — a test that calls everyone positive is 100% sensitive but 0% specific, so both numbers matter together.