Confusion Matrix Calculator
Enter TP, FP, FN, and TN values to instantly compute accuracy, precision, recall, F1 score, specificity, and Matthews Correlation Coefficient.
Confusion Matrix Inputs
Enter the four counts from your classifier's confusion matrix.
Actual +, predicted +
Actual −, predicted +
Actual +, predicted −
Actual −, predicted −
Matrix Visualization
| Predicted | ||
|---|---|---|
| Positive | Negative | |
| Actual + | — | — |
| Actual − | — | — |
Enter your confusion matrix values and click Calculate to see metrics.
Accuracy
—
Overall fraction of correct predictions.
Precision
—
Of all predicted positives, how many are correct.
Recall (Sensitivity)
—
Of all actual positives, how many were found.
F1 Score
—
Harmonic mean of precision and recall.
Specificity
—
Of all actual negatives, how many were correctly identified.
MCC
—
Matthews Correlation Coefficient. +1 = perfect, 0 = random, -1 = inverse.
Additional Rates
False Positive Rate
—
False Negative Rate
—
False Discovery Rate
—
Balanced Accuracy
—
Summary
Enter TP, FP, FN, and TN values to instantly compute accuracy, precision, recall, F1 score, specificity, and Matthews Correlation Coefficient.
How it works
- Enter the four confusion matrix counts: TP, FP, FN, and TN.
- The calculator instantly derives accuracy, precision, recall, F1 score, specificity, and MCC.
- A color-coded 2x2 matrix visualization updates in real time.
- Metric cards show the value and a plain-English interpretation.
- Use the Reset button to clear all fields and start over.
Use cases
- Evaluate a binary classifier such as a spam filter or fraud detector.
- Compare multiple model checkpoints by their F1 or MCC scores.
- Explain classification performance to stakeholders without writing code.
- Check whether precision or recall should be prioritized for your use case.
- Verify hand-calculated metrics from a research paper or report.
- Understand the trade-off between sensitivity and specificity in medical tests.