Statistics

Confusion Matrix Calculator

Evaluate a binary classifier with accuracy, precision, recall, specificity and F1 from four outcome counts.

Data stays on this deviceConvention explained below
Data explorer
Data explorer

Check the dataset and sample convention before interpreting results.

See the method

Add your observations

Runs on your device

Your statistical summary

Your result

Let’s calculate.

Use the Calculate button to see your result.

Review the method below for assumptions and conventions.

How to use this tool

  1. Enter true positives, false positives, false negatives, true negatives.
  2. Select Calculate to view the result.
  3. Check the method and assumptions below before using the result.

The method, explained

Accuracy = (TP+TN)/N. Precision = TP/(TP+FP). Recall = TP/(TP+FN). Specificity = TN/(TN+FP). F1 = 2TP/(2TP+FP+FN).

A WORKED EXAMPLE

Using true positives = 80, false positives = 10, false negatives = 20, true negatives = 90, the result is 0.85 probability. Change these example inputs to match your task; use the method above to check each step.

What to keep in mind

Binary labels only. Counts must come from the same evaluation set and decision threshold. This page does not diagnose medical conditions. A descriptive or probability calculation under the stated assumptions. Check the sample design and model before interpreting results.

Reference: NIST: statistical methods handbook

Common questions

What is the difference between precision and recall?

Precision asks how many predicted positives were actually positive. Recall asks how many actual positives were found. Their denominators differ, so one can be high while the other is low.

Why can a score be undefined?

A metric cannot be calculated when its denominator is zero. For example, precision is undefined if the model predicts no positive cases. The page labels this rather than silently substituting zero.

Methodology maintained by ClarityKit. How these tools are built and checked.