ConceptViz
ExamplesPricingAPIResourcesEducation ProgramAffiliates
Create
Data Science Tool

Confusion Matrix Generator with Metrics

Free confusion matrix generator — enter your classification counts for a labeled matrix with accuracy, precision, recall, and F1. Binary or multi-class.

Binary & multi-class — exact heatmap SVGAccuracy, precision, recall, F1 & specificityPer-class metrics and macro averagesDownload a publication-ready SVG — free

Enter your counts — renders an exact confusion matrix with accuracy, precision, recall & F1, free

Counts — rows = true class, columns = predicted

Positive
Negative
Accuracy90.0%
Macro F189.7%
Confusion Matrix Predicted label True label Positive Negative Positive Negative 72 8 12 108 Metrics Accuracy 90.0% Macro precision 89.4% Macro recall 90.0% Macro F1 89.7% Class Prec Recall F1 Positive 85.7% 90.0% 87.8% Negative 93.1% 90.0% 91.5% Recall of the positive class = sensitivity; specificity = 90.0%.

Confusion Matrix Generator

Describe your classification results
0 / 50,000 characters

Free to try ·

Preview

Your AI confusion matrix figure will appear here

For an exact matrix with computed metrics, use the Precise Matrix tab instead

Confusion Matrix Examples

Exact engine renders — binary and multi-class, with computed metrics

View:

Binary Classifier

Exact engine render — a 2×2 binary matrix with the full metrics panel.

binaryprecision-recallf1

Multi-Class Classifier

Exact engine render — a 3×3 multi-class matrix with per-class metrics and macro averages.

multi-classmacro-averageper-class

Medical Diagnostic Test

Exact engine render — a diagnostic test where sensitivity and specificity matter.

medicalsensitivityspecificity

Sentiment Analysis

Exact engine render — a positive/neutral/negative sentiment classifier.

sentimentnlpthree-class

Image Classification

Exact engine render — a five-class image classifier heatmap.

imagedeep-learningmulti-class

Fraud Detection

Exact engine render — an imbalanced fraud model where precision and recall matter more than accuracy.

fraudimbalancedbinary

What is a confusion matrix?

A confusion matrix is a table that shows how well a classification model performs by comparing its predicted labels against the true labels. Each row is a true (actual) class and each column is a predicted class, so the cell where they meet holds the number of cases with that true label that the model predicted as that class. The diagonal holds the correct predictions; everything off the diagonal is a mistake — hence "confusion." It works for a binary classifier (a 2×2 matrix of true positives, false positives, false negatives, and true negatives) and for any multi-class problem (an N×N matrix). This generator draws the matrix and computes the standard metrics from the counts you enter.

True positives, false positives, false negatives, true negatives

  • True Positive (TP): the model predicted positive and the true label is positive — a correct hit.
  • False Positive (FP): the model predicted positive but the true label is negative — a false alarm (Type I error).
  • False Negative (FN): the model predicted negative but the true label is positive — a miss (Type II error).
  • True Negative (TN): the model predicted negative and the true label is negative — a correct rejection.

The metrics: accuracy, precision, recall, and F1

Accuracy = (TP + TN) / (TP + FP + FN + TN) — the share of all predictions that were correct. Precision = TP / (TP + FP) — of everything predicted positive, how much really was positive. Recall (also called sensitivity or the true positive rate) = TP / (TP + FN) — of all the real positives, how many the model found. Specificity = TN / (TN + FP) — the true negative rate. The F1 score = 2 × (precision × recall) / (precision + recall) is the harmonic mean of precision and recall, useful when classes are imbalanced. For a multi-class matrix, precision, recall, and F1 are computed per class and then averaged (macro average). This tool shows all of these next to the matrix so the downloaded figure is self-contained.

How to make your confusion matrix

  • Label your classes — keep the two default classes for a binary model, or add classes for a multi-class problem.
  • Enter the counts in the grid: each row is a true class and each column is the predicted class, with the correct predictions on the diagonal.
  • Read the metrics panel — accuracy, macro precision/recall/F1, and a per-class breakdown update as you type.
  • Download a clean, scalable SVG for your paper, report, notebook, or slides — free, with no sign-up.

Precision vs recall: which matters?

Precision and recall trade off against each other, and which one you optimize depends on the cost of each error. When a false positive is expensive — for example flagging a legitimate email as spam — you want high precision. When a false negative is expensive — for example missing a disease in a screening test — you want high recall (sensitivity). The F1 score balances the two, and a confusion matrix lets you see the raw counts behind them so you can judge the trade-off for your own problem rather than trusting accuracy alone, which can be misleading on imbalanced data.

Frequently Asked Questions

Related Data & Stats Tools

Bell Curve GeneratorResearch

Bell Curve Generator

Plot a normal distribution with shaded areas, z-scores, and standard deviations.

Try it free
Box Plot GeneratorResearch

Box Plot Generator

Draw box-and-whisker plots showing quartiles, medians, and outliers.

Try it free
Histogram MakerResearch

Histogram Maker

Turn a data set into a histogram showing the shape of its distribution.

Try it free
Forest Plot GeneratorResearch

Forest Plot Generator

Plot pooled effect sizes with confidence intervals for a meta-analysis.

Try it free
Scatter Plot MakerResearch

Scatter Plot Maker

Plot paired data points to reveal correlation and trends between variables.

Try it free
View All Free Tools
ConceptViz

Turn your science ideas into clear diagrams effortlessly.

contact@conceptviz.app
Product
  • Pricing
  • API
  • Blog
  • FAQ
  • Examples
Company
  • About
  • Contact
  • Friends
  • Affiliate Program
Legal
  • License
  • Terms
  • Privacy
  • Content Policy
  • Cookies
  • Refund
Community
  • Education Program
Free Tools
  • Animal Cell Diagram
  • Plant Cell Diagram
  • Animal vs Plant Cell
  • Water Cycle Diagram
  • Christmas Science Coloring Pages
  • More Tools →

Friends links

  • Featured on Toolfio
© 2026 ConceptViz. All rights reserved.