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
| Metric | Formula | Description |
|---|---|---|
| Accuracy | (TP + TN) / (TP + TN + FP + FN) | Overall proportion of correct predictions. |
| Error Rate | (FP + FN) / Total | Proportion of incorrect predictions. |
| Precision | TP / (TP + FP) | Out of all predicted positive, how many were actually positive? |
| Recall / Sensitivity | TP / (TP + FN) | Out of all actual positives, how many were correctly predicted? |
| Specificity | TN / (TN + FP) | Out of all actual negatives, how many were correctly predicted? |
| F1-Score | 2 * (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. |