Confusion Matrix Calculator

Calculate, analyze, and visualize classification model evaluation metrics including Accuracy, Precision, Recall, F1-Score, MCC, and Cohen's Kappa instantly in your browser.

Enter the raw counts for your binary classification matrix.

Paste your actual classes (0 or 1) and predicted probabilities (0.0 to 1.0) separated by comma or tab. Adjust the threshold to see how metrics change.

Paste Actual vs Predicted labels (comma or tab separated) OR upload a CSV file.

Formulas & Guide

MetricFormulaDescription
Accuracy(TP + TN) / (TP + TN + FP + FN)Overall proportion of correct predictions.
Error Rate(FP + FN) / TotalProportion of incorrect predictions.
PrecisionTP / (TP + FP)Out of all predicted positive, how many were actually positive?
Recall / SensitivityTP / (TP + FN)Out of all actual positives, how many were correctly predicted?
SpecificityTN / (TN + FP)Out of all actual negatives, how many were correctly predicted?
F1-Score2 * (Precision * Recall) / (Precision + Recall)Harmonic mean of precision and recall. Best for imbalanced datasets.
MCC(TP*TN - FP*FN) / sqrt(...)Matthews Correlation Coefficient. Range [-1, 1]. Reliable even on imbalanced data.

Frequently Asked Questions

Related Keywords & Tags (Click to expand)
Message