Home · Statistics · Probability & Combinatorics · Correlation Coefficient Calculator (Matthews)

Correlation Coefficient Calculator (Matthews)

The Matthews correlation coefficient of a binary classifier: a single score from all four confusion-matrix cells that stays trustworthy even when the classes are badly imbalanced.

Your figures

Example result — edit the figures to make it yours

0.7035

Sensitivity (recall)80%
Specificity90%
Positive predictive value (precision)88.888889%
Negative predictive value81.818182%
False positive rate10%
False negative rate20%

What this calculator does

The Matthews correlation coefficient of a binary classifier: a single score from all four confusion-matrix cells that stays trustworthy even when the classes are badly imbalanced. 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

MCC = (TP·TN − FP·FN) / √((TP+FP)(TP+FN)(TN+FP)(TN+FN))

MCC is the Pearson correlation between the true and predicted labels, so it runs from −1 (total disagreement) through 0 (no better than chance) to +1 (perfect).

It uses all four cells symmetrically: swapping which class is called positive leaves the value unchanged.

If any bracketed sum in the denominator is zero the coefficient is undefined and is conventionally reported as 0.

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 0.7035. Change any figure and the result updates with the same formula.

Quick reference

Quick reference — varying true positives
True positivesResult
400.5919
640.6724
800.7035
1000.7303
1200.7492
1600.7740

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

Common questions

Why use MCC instead of accuracy or F1?

Accuracy ignores the class balance and F1 ignores true negatives entirely. MCC only scores highly when a classifier does well on both classes in proportion to their sizes, so it cannot be flattered by a dominant class.

What MCC counts as a good classifier?

As a rough guide, above 0.5 is a strong association and above 0.7 very strong, but the useful comparison is against other models on the same data rather than a universal cutoff.

How does the Correlation Coefficient Calculator (Matthews) work?

The Matthews correlation coefficient of a binary classifier: a single score from all four confusion-matrix cells that stays trustworthy even when the classes are badly imbalanced. True positives · False positives · False negatives · True negatives → Matthews correlation coefficient. 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 Correlation Coefficient Calculator (Matthews) need?

True positives · False positives · False negatives · True negatives → Matthews correlation coefficient. 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.