Productive Toolbox

Confusion Matrix Calculator

Calculate confusion matrix metrics instantly online. Get accuracy, precision, recall, specificity, F1 score, MCC, and more for machine learning classification models.

🧩

Confusion Matrix Calculator

Enter confusion matrix values (TP, FP, FN, TN) to instantly calculate all classification metrics — accuracy, precision, recall, F1, MCC, and more. Upload a CSV for automatic matrix generation. We do not collect or store what you enter.

Confusion Matrix Values

Correctly predicted positive

Missed positive (Type II)

Wrong positive (Type I)

Correctly predicted negative

Total samples200

Ctrl+Enter to recalculate

Confusion Matrix

← Predicted Pos | Predicted Neg →
90
TP
45.0%
20
FN
10.0%
10
FP
5.0%
80
TN
40.0%
↑ Actual Pos↓ Actual Neg

Example Scenarios

Key Metrics

85.00%
Accuracy
90.00%
Precision
81.82%
Recall
F1 Score85.71%
Specificity88.89%
MCC0.7035
Total samples: 200Positives: 110 · Negatives: 90
Accuracy
85.00%
Fraction of all predictions that were correct.
Precision
90.00%
Of all predicted positives, how many were correct?
Recall
81.82%
Of all actual positives, how many were found?
Specificity
88.89%
Of all actual negatives, how many were correctly identified?
F1 Score
85.71%
Harmonic mean of precision and recall.
FPR
11.11%
False Positive Rate (1 − Specificity).
FNR
18.18%
False Negative Rate (1 − Recall).
NPV
80.00%
Negative Predictive Value — accuracy of negative predictions.
Balanced Acc.
85.35%
(Recall + Specificity) / 2. Fair for imbalanced classes.
MCC
0.7035
Matthews Correlation Coefficient (−1 to +1).

Metrics Overview

Accuracy85.00%
Precision90.00%
Recall81.82%
Specificity88.89%
F1 Score85.71%
Balanced Accuracy85.35%

Frequently Asked Questions

What does a confusion matrix tell you?

It breaks down all prediction outcomes into four categories — TP, TN, FP, FN — letting you see exactly where your model succeeds and where it fails. From these you can calculate every classification metric without needing the raw predictions.

What is a good accuracy for a classification model?

It depends heavily on the dataset. For balanced datasets, 90%+ is typically good. For heavily imbalanced datasets, accuracy can be misleading — a model predicting the majority class 100% of the time could score 99% accuracy while being completely useless.

What is the difference between sensitivity and specificity?

Sensitivity (recall) measures how well the model finds actual positives. Specificity measures how well it correctly identifies actual negatives. A good diagnostic test aims for high values of both.

Why is MCC considered a better metric than F1?

MCC (Matthews Correlation Coefficient) uses all four values of the confusion matrix and is not inflated by class imbalance. F1 ignores true negatives entirely. For datasets where TN is large (common in fraud detection), MCC gives a more balanced assessment.

Can I upload predictions directly?

Yes. Use the CSV Upload mode and provide a two-column CSV with columns 'actual' and 'predicted'. The calculator parses binary values (1/0) or string labels (positive/negative, yes/no) and builds the confusion matrix automatically.