Part of the AI & Machine Learning suite · 24 calculators

Confusion Matrix Metrics Calculator

Every standard classification metric from the four cells of a confusion matrix — accuracy, precision, recall, specificity, F1, balanced accuracy and Matthews correlation — with a reading of which one to trust for your class balance.

A binary classifier's results fit in four boxes: true positives, false positives, false negatives, true negatives.

Results update as you type
Results
F1 score
0.8571
Accuracy
Precision
Recall (sensitivity)
Specificity
Balanced accuracy
Matthews correlation
Positive prevalence
Accuracy of always predicting the majority class
Reading
Reviewed September 2026. Model arithmetic is the same everywhere: the same formulas in every market, in your own currency. Australia's AI Ethics Principles are voluntary; cost and sizing arithmetic carries no regulatory requirement.
No account required · Google Analytics off unless allowedCalculator arithmetic runs in your browserResults update as you type
All calculations run 100% in your browser. The calculator code does not submit your figures to GlobalCalc to obtain a result.
About confusion matrix metrics

How the confusion matrix metrics calculator works

A binary classifier's results fit in four boxes: true positives, false positives, false negatives, true negatives. Accuracy is the share right overall, and it lies when the classes are unbalanced: predicting "no fraud" every time is 99% accurate. Precision asks how many flagged items were real; recall asks how many real items were flagged; F1 balances them.

Matthews correlation uses all four cells and stays honest on any class balance, which is why it is the one to quote when the positives are rare.

Formula: precision = TP/(TP+FP); recall = TP/(TP+FN); F1 = 2PR/(P+R); MCC = (TP·TN − FP·FN) / √((TP+FP)(TP+FN)(TN+FP)(TN+FN))

Worked examples

InputsF1 scoreNote
20% positives, a decent model0.8571F1 0.86
Rare positives0.533398.6% accurate, F1 0.53
A perfect classifier1everything 1

Frequently asked questions

What is a confusion matrix?

The four counts of a binary classifier's results: right and wrong, for positives and negatives. Every classification metric is a ratio of some of those four.

Precision or recall?

Precision when a false alarm is costly — a spam filter. Recall when a miss is costly — a cancer screen. F1 when both matter and you need one number.

Why not just use accuracy?

Because with rare positives a model that never predicts positive is highly accurate and useless. The baseline row shows what accuracy you get for free.

What is Matthews correlation?

The correlation between predicted and true labels, from −1 to 1, using all four cells. It is the most honest single number for imbalanced data.

What is balanced accuracy?

The average of recall and specificity — accuracy as if the classes were equally common. It is what accuracy would be on a balanced test set.

Where these figures come from

Last checked: September 2026. The relationships here are architectural, not vendor-specific: bytes per parameter follow the numeric format, KV-cache size follows the transformer definition, and token-per-word ratios come from published tokeniser behaviour.