Skip to main content
Calcimator

Confusion Matrix Analyzer

Analyze classification model performance from confusion matrix values. Calculate precision, recall, F1 score, MCC, accuracy, specificity, and more.

About this calculator

This calculator turns four raw counts — True Positives, False Positives, True Negatives, and False Negatives — into the standard classification metrics. Precision is tp / (tp + fp) and Recall is tp / (tp + fn) (lines 11-12), and neither formula ever references True Negatives, so True Negatives has zero effect on both. Since F1 Score is built purely from Precision and Recall (2·P·R / (P+R), line 13), it inherits that same blind spot and never responds to True Negatives either — a fact that surprises people expecting F1 to summarize "all four" quadrants of the matrix the way Accuracy does. Specificity, on the other hand, is tn / (tn + fp) (line 14) and is correspondingly blind to True Positives and False Negatives.

Accuracy is the only headline metric here that uses all four counts at once ((tp + tn) / total, line 10). The Matthews Correlation Coefficient (line 19-23) is the one metric designed specifically to stay informative even when the two classes are wildly imbalanced, since it multiplies all four cells together in its numerator rather than only ever looking at two or three of them. This calculator does not report confidence intervals or statistical significance for any metric — with small counts, a plausible sampling difference of just a few cases can shift Precision, Recall, or F1 by several points, and this page has no way to distinguish that noise from a genuine change in model performance.

Inputs

Results

Accuracy

0.9

Precision

0.83

Recall (Sensitivity)

0.91

F1 Score

0.87

Matthews Correlation Coeff.0.79
Specificity0.89
False Positive Rate0.11
Balanced Accuracy0.9
Prevalence0.38
Total Samples145
How to Use This Calculator
  1. Enter the true positive, false positive, true negative, and false negative counts from your model.
  2. Review accuracy, precision, recall (sensitivity), and F1-score.
  3. Check specificity and Matthews Correlation Coefficient for balanced evaluation.
  4. Identify whether false positives or false negatives are more costly for your use case.
  5. Adjust the classification threshold to trade off precision vs. recall based on business requirements.

How the result changes with False Positives (FP)

False Positives (FP)AccuracyPrecisionRecall (Sensitivity)
50.930.910.91
7.50.910.870.91
150.870.770.91
250.810.670.91

What each input means

True Positives (TP)
Correctly predicted positive cases — the model said positive and it was positive.
False Positives (FP)
Incorrectly predicted positive cases — the model said positive but it was negative (Type I error).
True Negatives (TN)
Correctly predicted negative cases — the model said negative and it was negative.
False Negatives (FN)
Incorrectly predicted negative cases — the model said negative but it was positive (Type II error).

How this is calculated

Worked example, using the default values

  1. Identify Input Parameters
    4 parameters
    True Positives (TP) = 50, False Positives (FP) = 10, True Negatives (TN) = 80, False Negatives (FN) = 5 = 4 input(s) provided
  2. Calculate Accuracy
    Accuracy
    0.8966 = 0.8966
  3. Calculate Precision
    Precision
    0.8333 = 0.8333
  4. Calculate Recall
    Recall
    0.9091 = 0.9091
  5. Calculate Matthews Correlation Coeff.
    Matthews Correlation Coeff.
    0.7862 = 0.7862
  6. Calculate Specificity
    Specificity
    0.8889 = 0.8889

Engine last updated . Checked against 1 independently-derived test — how we verify calculators. Built by Paul Gunder, a software engineer, not a licensed financial, medical, or legal professional.

Frequently Asked Questions

Does the number of True Negatives affect the Precision or Recall shown?

No. Precision is tp / (tp + fp) and Recall is tp / (tp + fn) (lines 11-12) — neither formula includes True Negatives at all, so raising or lowering True Negatives leaves both figures completely unchanged, even though it does move Accuracy and Specificity.

Why doesn't F1 Score respond to True Negatives if it's supposed to be an overall metric?

F1 Score is the harmonic mean of Precision and Recall alone (2·P·R / (P+R), line 13), and since neither of those two inputs uses True Negatives, F1 inherits that same blind spot. It summarizes how well positives are found and confirmed, not overall correctness — that's what Accuracy and Balanced Accuracy are for.

Which metrics ignore True Positives and False Negatives entirely?

Specificity (tn / (tn + fp), line 14) and False Positive Rate (1 − specificity, line 15) both depend only on True Negatives and False Positives. They measure how well the model avoids false alarms on the negative class, independent of how it performs on positives at all.

What makes the Matthews Correlation Coefficient different from the other metrics here?

MCC's numerator is tp·tn − fp·fn (line 19) — the only formula on this page that multiplies all four counts together at once, rather than using only two or three of them. That's why it's commonly recommended over Accuracy or F1 when the positive and negative classes are very unevenly sized.

The questions that sit next to this one — chosen by subject, including calculators filed under a different category.

More in Math & Statistics.