Computing & Software

Binary Classifier Confusion Matrix Metrics Calculator

Calculate common threshold-specific performance metrics from four binary-classification counts.

How the calculation works

Accuracy = (tp+tn)/(tp+fp+fn+tn) fraction. Precision = tp/(tp+fp) fraction. Recall / true positive rate = tp/(tp+fn) fraction. Specificity = tn/(tn+fp) fraction. F1 score = 2*tp/(2*tp+fp+fn) fraction. Balanced accuracy = (tp/(tp+fn)+tn/(tn+fp))/2 fraction.

Worked example

Example inputs — True positives: 80; False positives: 20; False negatives: 10; True negatives: 90. Expected results — Accuracy: 0.85 fraction; Precision: 0.8 fraction; Recall / true positive rate: 0.8888888889 fraction; Specificity: 0.8181818182 fraction; F1 score: 0.8421052632 fraction; Balanced accuracy: 0.8535353535 fraction.

Assumptions and limits

Analytical software/hardware scenario, not a benchmark or a live provider quote. Use the actual architecture, workload and billing definitions; overheads not named in the model are excluded. Binary counts with a fixed definition of the positive class. Undefined-denominator cases are rejected rather than silently assigned a score; accuracy alone can hide imbalance.

Reference and further reading

Read the underlying subject reference. Calculith is an independent implementation; the reference does not endorse or certify this tool.

Related calculators

Browse all 1000 calculators →

Example values are editable. Results are estimates where assumptions apply. Calculations run in your browser. Updated 2026-11-16.