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.
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
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
| True positives | Result |
|---|---|
| 40 | 81.25 |
| 64 | 83.70 |
| 80 | 85.00 |
| 100 | 86.36 |
| 120 | 87.50 |
| 160 | 89.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.