698 tools
All

Confusion Matrix Calculator

Calculate sensitivity, specificity, positive predictive value, and accuracy from TP, FN, FP, and TN counts.

 

 

 

 

Sensitivity
Specificity
PPV
Accuracy

About this calculator

Use this calculator after a binary classifier or diagnostic test when you have a 2×2 confusion matrix: true positives, false negatives, false positives, and true negatives. It reports how often the test catches true cases, how often it clears true non-cases, how often a positive is truly positive, and overall correctness.

The formulas are: sensitivity = TP / (TP + FN), specificity = TN / (TN + FP), PPV (precision) = TP / (TP + FP), and accuracy = (TP + TN) / n. Counts 80, 20, 10, 90 give sensitivity 0.80, specificity 0.90, PPV ≈ 0.889, and accuracy 0.85.

PPV still depends on prevalence in the evaluated set. You need positives, negatives, and at least one predicted positive. This is not an F1 score or an ROC curve.

TP: True positives (correctly flagged cases).

FN: False negatives (missed cases).

FP: False positives (false alarms).

TN: True negatives (correctly cleared non-cases).

Sensitivity: True-positive rate, TP / (TP + FN).

Specificity: True-negative rate, TN / (TN + FP).

PPV: Positive predictive value, TP / (TP + FP).

Accuracy: Share of all counts that are correct.