Confusion Matrix Calculator

Enter TP, FP, FN, and TN values to instantly compute accuracy, precision, recall, F1 score, specificity, and Matthews Correlation Coefficient.

Confusion Matrix Inputs

Enter the four counts from your classifier's confusion matrix.

Actual +, predicted +

Actual −, predicted +

Actual +, predicted −

Actual −, predicted −

Matrix Visualization

Predicted
Positive Negative
Actual +
Actual −
Correct Incorrect

Enter your confusion matrix values and click Calculate to see metrics.

Copied!

Summary

Enter TP, FP, FN, and TN values to instantly compute accuracy, precision, recall, F1 score, specificity, and Matthews Correlation Coefficient.

How it works

  1. Enter the four confusion matrix counts: TP, FP, FN, and TN.
  2. The calculator instantly derives accuracy, precision, recall, F1 score, specificity, and MCC.
  3. A color-coded 2x2 matrix visualization updates in real time.
  4. Metric cards show the value and a plain-English interpretation.
  5. Use the Reset button to clear all fields and start over.

Use cases

  • Evaluate a binary classifier such as a spam filter or fraud detector.
  • Compare multiple model checkpoints by their F1 or MCC scores.
  • Explain classification performance to stakeholders without writing code.
  • Check whether precision or recall should be prioritized for your use case.
  • Verify hand-calculated metrics from a research paper or report.
  • Understand the trade-off between sensitivity and specificity in medical tests.

Frequently Asked Questions

Last updated: 2026-06-10 · Reviewed by Nham Vu