🧮 Matthews Correlation Coefficient Calculator
Enter the true positive, true negative, false positive, and false negative counts from a confusion matrix to compute the Matthews Correlation Coefficient (MCC).
What this calculator does
The Matthews Correlation Coefficient (MCC) is a single-number metric for evaluating binary classification models, especially useful when classes are imbalanced. It uses all four cells of a confusion matrix — true positives, true negatives, false positives, and false negatives — to summarize how well a classifier performs.
How the calculation works
MCC is computed as (TP x TN – FP x FN) divided by the square root of (TP+FP)(TP+FN)(TN+FP)(TN+FN). The result ranges from -1 to +1: +1 means perfect prediction, 0 means no better than random guessing, and -1 means total disagreement between predictions and actual outcomes. If any of the four sums in the denominator is zero, the calculator treats MCC as 0 to avoid an undefined result.
Unlike accuracy, MCC accounts for all four confusion matrix categories and is generally considered a more reliable measure when the positive and negative classes have very different sizes. This tool is for general data science and educational use.