Confusion Matrix & F1 Score Calculator

Enter true/false positives and negatives to compute accuracy, precision, recall, specificity, F1 score, MCC and balanced accuracy instantly.

🔒 Processed locally in your browser — we don’t upload your input.

How to use the Confusion Matrix

Accuracy alone can be dangerously misleading: a fraud model that always predicts “not fraud” may be 99% accurate and completely useless. The confusion matrix shows how predictions are actually distributed, and the metrics derived from it reveal how a classifier behaves on each class. Enter the four counts — true positives, false positives, false negatives and true negatives — and this calculator computes all the standard evaluation metrics.

You get accuracy, precision (positive predictive value), recall (sensitivity or true positive rate), specificity, F1 score, a configurable F-beta score, balanced accuracy, negative predictive value, false positive rate and the Matthews correlation coefficient (MCC), which is considered one of the most reliable single numbers for imbalanced data. The matrix is displayed as a grid so you can present it in reports, and each metric shows its formula for learning and verification.

Use it to evaluate machine-learning classifiers, LLM-based labelling or moderation systems, medical test results, or spam filters. Students can check homework answers and engineers can sanity-check numbers from scikit-learn or evaluation dashboards. All maths runs locally in your browser.

Frequently asked questions

What is the F1 score?

The harmonic mean of precision and recall: 2·P·R/(P+R).

When should I use MCC?

For imbalanced datasets; it uses all four cells and ranges from −1 to 1.

What is F-beta?

A weighted F score; beta > 1 favours recall, beta < 1 favours precision.

What if a denominator is zero?

The metric is shown as not defined rather than a misleading number.

About this tool

Enter true/false positives and negatives to compute accuracy, precision, recall, specificity, F1 score, MCC and balanced accuracy instantly. People also look for: confusion matrix calculator, f1 score calculator, precision recall calculator, model evaluation metrics.

Related searches