Multiclass Confusion Matrix Calculator

Turn confusion counts into actionable multiclass performance insights. Inspect per-class metrics, supports, and error distributions. Spot weak labels faster using summaries, exports, and heatmaps.

Calculator Input

Paste class labels and a square confusion matrix. Use rows for actual classes and columns for predicted classes.

Separate labels with commas or new lines.
Controls displayed metric precision.
Switch between volume and normalized error patterns.
Use one row per line. Separate values with commas, spaces, tabs, or semicolons.

Example Data Table

This sample matrix uses four classes. The same values are available through the example button above.

Actual \ Predicted Class A Class B Class C Class D
Class A 52 4 2 1
Class B 5 48 6 1
Class C 2 7 45 3
Class D 1 2 4 50

Formula Used

How to Use This Calculator

  1. Enter class names in the same order used by your confusion matrix.
  2. Paste the matrix values so each line represents one actual class.
  3. Keep rows as actual labels and columns as predicted labels.
  4. Choose the number of decimal places for displayed metrics.
  5. Select whether the heatmap should show counts or row percentages.
  6. Click Calculate Matrix Metrics to generate results above the form.
  7. Review summary cards, the matrix table, and class-level metrics together.
  8. Use CSV or PDF export buttons to save the report.

FAQs

1. What is a multiclass confusion matrix?

A multiclass confusion matrix compares actual labels against predicted labels for three or more classes. Diagonal cells show correct predictions, while off-diagonal cells show where the model confuses one class with another.

2. Which axis is actual and which is predicted?

This calculator assumes rows are actual classes and columns are predicted classes. Keep that orientation consistent when pasting your matrix, or the class-wise metrics will be interpreted incorrectly.

3. Why do macro and weighted averages differ?

Macro metrics average every class equally. Weighted metrics give larger classes more influence. Use macro values to inspect fairness across classes and weighted values to reflect dataset composition.

4. Why does micro F1 match accuracy here?

In single-label multiclass classification, each sample gets one prediction. Under that setting, micro precision, micro recall, and micro F1 collapse to overall accuracy.

5. Can I use weighted counts instead of raw observations?

Yes. Weighted counts or normalized frequencies can be entered, but interpret totals carefully. Accuracy-like ratios still work, while support and raw mistake counts no longer represent whole observations.

6. What does specificity mean in multiclass work?

Specificity measures how well one class avoids false positives in a one-vs-rest comparison. Higher specificity means the model rarely predicts that class when it should not.

7. Why is MCC useful for imbalanced classes?

MCC stays informative even when classes are imbalanced. It rewards correct structure across the full matrix and penalizes misleading performance that accuracy alone can hide.

8. How large can the matrix be?

Small and medium matrices work comfortably in most browsers. Very large matrices remain possible, but wider tables, denser heatmaps, and PDF exports become harder to read.

Related Calculators

cohen kappa calculatormatthews correlation calculatormisclassification rate calculatorjaccard index calculator

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.