Accuracy Calculator

Accuracy is the fraction of all predictions your classifier got right: (TP + TN) ÷ (TP + FP + FN + TN). Enter the four confusion-matrix counts and see the accuracy — plus the error rate, which is 1 − accuracy.

Correctly predicted positives.

Predicted positive but actually negative.

Predicted negative but actually positive.

Correctly predicted negatives.

Result

Enter your values and press Calculate — the result appears here.

Worked examples

85 correct out of 100

  • tp = 50
  • fp = 10
  • fn = 5
  • tn = 35

Result: Accuracy 0.85 (85%) · Error rate 0.15

Perfect predictions

  • tp = 40
  • fp = 0
  • fn = 0
  • tn = 60

Result: Accuracy 1.00 (100%)

Frequently asked questions

What does accuracy measure?

The proportion of predictions that were correct. It is the simplest classification metric, but on imbalanced data it can be misleading — 90% accuracy is weak if 90% of examples are one class and the model simply always predicts it.

Why is accuracy undefined when all counts are zero?

Accuracy divides by the total number of predictions. With no predictions at all (TP = FP = FN = TN = 0) the formula is 0 ÷ 0, which has no meaningful value.

What is the error rate?

The error rate is the share of predictions that were wrong: (FP + FN) ÷ N, which equals 1 − accuracy. Some teams report one, some the other.

Copied!