Home · Statistics · Probability & Combinatorics · Confusion Matrix Calculator

Confusion Matrix Calculator

All the standard rates of a confusion matrix from its four counts — accuracy, sensitivity, specificity, precision and more — with overall accuracy as the headline.

Your figures

Example result — edit the figures to make it yours

85

Sensitivity (recall)80%
Specificity90%
Positive predictive value (precision)88.888889%
Negative predictive value81.818182%
False positive rate10%
False negative rate20%
Total cases200
Actual positives100
Predicted positives90

What this calculator does

All the standard rates of a confusion matrix from its four counts — accuracy, sensitivity, specificity, precision and more — with overall accuracy as the headline. Every figure on this page is computed from the standard definition stated below — the same definition used in textbooks and reference tables — with no hidden rounding steps, and the method notes name the exact convention where more than one exists.

The formula and method

Accuracy = (TP + TN) / (TP + FP + FN + TN) × 100%

Enter the four cells: true positives, false positives, false negatives and true negatives.

Every rate is a ratio of these cells: sensitivity = TP/(TP+FN), specificity = TN/(TN+FP), precision = TP/(TP+FP).

The headline is overall accuracy; the other rates are reported alongside it.

Worked example

With the example inputs this page opens with (true positives 80, false positives 10, false negatives 20, true negatives 90), the result is 85.00. Change any figure and the result updates with the same formula.

Quick reference

Quick reference — varying true positives
True positivesResult
4081.25
6483.70
8085.00
10086.36
12087.50
16089.29

Computed with the same formulas as the calculator above — enter any values there for figures beyond this table.

Common questions

How do I read a confusion matrix?

Rows are the actual class and columns the predicted class. The diagonal (TP and TN) holds the correct calls; the off-diagonal cells are the two error types, false alarms (FP) and misses (FN).

Which single number best summarises the matrix?

For balanced data, accuracy is fine. For imbalanced data the Matthews correlation coefficient is the safer single figure, since it uses all four cells and stays honest when one class dominates.

How does the Confusion Matrix Calculator work?

All the standard rates of a confusion matrix from its four counts — accuracy, sensitivity, specificity, precision and more — with overall accuracy as the headline. True positives · False positives · False negatives · True negatives → Accuracy (%). The result updates as you type, and the formula and method on this page state the exact definitions used, so you can reproduce the calculation by hand.

What inputs does the Confusion Matrix Calculator need?

True positives · False positives · False negatives · True negatives → Accuracy (%). Invalid entries — such as a zero denominator, an out-of-range value or a malformed list — produce a plain-language message instead of a misleading number.