Skip to content
ENExplore Calculators

MCC Calculator

Calculate the Matthews Correlation Coefficient for binary classification quality.

About MCC Calculator

The Matthews Correlation Coefficient (MCC) is a single-number summary of binary classification quality that uses all four confusion matrix values: MCC = (TP×TN − FP×FN) / √[(TP+FP)(TP+FN)(TN+FP)(TN+FN)]. It ranges from -1 (total disagreement) through 0 (no better than random) to +1 (perfect prediction). Unlike accuracy or F1, MCC accounts for true negatives directly and remains informative even on severely imbalanced datasets, which is why it's often recommended as the preferred single-metric summary for binary classifiers.

Formula

MCC = (TP * TN - FP * FN) / sqrt((TP + FP)(TP + FN)(TN + FP)(TN + FN))

TP
True positives
TN
True negatives
FP
False positives
FN
False negatives

Worked example

With the default values below, MCC Calculator returns Matthews Correlation Coefficient of 0.8262. Change any input above and every figure here is recalculated in your browser.

Inputs used

True Positives (TP)accepts 0–1,000,000,000
80
True Negatives (TN)accepts 0–1,000,000,000
850
False Positives (FP)accepts 0–1,000,000,000
20
False Negatives (FN)accepts 0–1,000,000,000
10

Results

Matthews Correlation Coefficient
0.8262
Numerator
67,800
Denominator
82,059.7343

Step by step

  1. 1Numerator: (TP × TN) − (FP × FN)= 67800
  2. 2Denominator: √[(TP+FP)(TP+FN)(TN+FP)(TN+FN)]= 82059.7343
  3. 3MCC: numerator / denominator= 0.8262

Assumptions and limits

  • The result is derived only from the 4 inputs listed above. Anything not among them is not part of the calculation.
  • In particular, this calculator does not take inflation, tax, fees or charges or compounding frequency into account.
  • Figures are rounded for display to 4 decimal places, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.

How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.

Frequently Asked Questions

Why is MCC considered better than accuracy for imbalanced data?

MCC incorporates all four confusion matrix cells (TP, TN, FP, FN) in a balanced way, so a model that only performs well on the majority class will not score highly, unlike accuracy which can be dominated by the majority class.

What does an MCC of 0 mean?

An MCC of 0 indicates the classifier's predictions are no better than random guessing given the class distribution — it carries no useful correlation between predictions and actual labels.

Can MCC be undefined?

Yes — if the denominator is zero (which happens when the model predicts only one class, or the confusion matrix has an entire row or column of zeros), MCC is undefined; this calculator returns 0 in that case as a safe fallback.

MCC Calculator – Calculate Matthews Correlation Coefficient