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
Ctrl+Enter to recalculate
Confusion Matrix
Example Scenarios
Key Metrics
Metrics Overview
Related tools
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.
Related Tools
Model Accuracy Calculator
Compute accuracy from predictions.
Precision Recall Calculator
Calculate precision and recall metrics.
F1 Score Calculator
Calculate the F1 score, precision and recall from a confusion matrix or from precision and recall values.
Dataset Split Calculator
Split datasets into train, validation, and test sets for machine learning.
AI Token Cost Calculator
Estimate cost per token usage.
AI Prompt Length Calculator
Calculate token length.
Time Complexity Calculator
Estimate Big-O complexity growth.
Cloud Cost Calculator
Estimate cloud usage cost.
Combinatorics Calculator
Calculate permutations and combinations.
Subnet Calculator
Calculate subnet mask, network, and hosts.
IP Range Calculator
Determine IP address range.
CIDR Calculator
Calculate CIDR notation details.