Confusion Matrix Calculator
For data science students, interview candidates and ML engineers evaluating a classifier. You get accuracy, precision, recall, specificity, F1 and the total sample count from the four confusion matrix cells.
Close the gaps with real-world projects
Build industry projects on ByteLabs and add verified proof of your skills to your public profile.
How to use the Confusion Matrix Calculator
- Enter True Positives (TP) and False Positives (FP).
- Enter False Negatives (FN) and True Negatives (TN).
- Click Compute metrics.
- Read accuracy, precision, recall, specificity and F1 score.
An example, step by step (example only)
You enter
TP 90, FP 10, FN 5, TN 95
The tool shows
Accuracy 0.925 (92.5%), precision 0.9, recall 0.9474, specificity 0.9048, F1 0.9231, 200 samples
Questions about the Confusion Matrix Calculator
What is the difference between precision and recall?
Precision is TP divided by TP plus FP: of everything predicted positive, how much was right. Recall is TP divided by TP plus FN: of all real positives, how many were found.
When is F1 score better than accuracy?
On imbalanced data. If 95 percent of samples are negative, a model that always says negative gets 95 percent accuracy but an F1 of 0, so F1 shows the real performance on the positive class.
What is specificity in a confusion matrix?
Specificity, or true negative rate, is TN divided by TN plus FP: the share of real negatives the model correctly rejected.
Is the Confusion Matrix Calculator free and private?
Yes. It is free, needs no sign-up and runs entirely in your browser, so what you type is not uploaded. You only sign in if you want to email a result to yourself or save it to your CareerByteCode profile.